summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 2012-03-01 Pedro Alves <palves@redhat.com>Pedro Alves2012-03-012-2/+11
| | | | | | | * 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.
* 2012-03-01 Pedro Alves <palves@redhat.com>Pedro Alves2012-03-012-0/+11
| | | | | | * observer.c (observer_test_first_notification_function) (observer_test_second_notification_function) (observer_test_third_notification_function): Add declarations.
* 2012-03-01 Pedro Alves <palves@redhat.com>Pedro Alves2012-03-017-52/+53
| | | | | | | | | | | | | | | | | * 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.
* 2012-03-01 Pedro Alves <palves@redhat.com>Pedro Alves2012-03-012-0/+7
| | | | | * jit-reader.in (plugin_is_GPL_compatible): Add declarations for both __cplusplus and !__cplusplus.
* 2012-03-01 Pedro Alves <palves@redhat.com>Pedro Alves2012-03-014-24/+29
| | | | | | * 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.
* 2012-03-01 Pedro Alves <palves@redhat.com>Pedro Alves2012-03-012-0/+5
| | | | * inline-frame.c: Include inline-frame.h.
* 2012-03-01 Pedro Alves <palves@redhat.com>Pedro Alves2012-03-014-25/+6
| | | | | | * 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.
* 2012-03-01 Pedro Alves <palves@redhat.com>Pedro Alves2012-03-014-4/+11
| | | | | | * remote.c (encode_actions): Delete declaration. * tracepoint.c (encode_actions): Make extern. * tracepoint.h (encode_actions): Declare.
* 2012-03-01 Pedro Alves <palves@redhat.com>Pedro Alves2012-03-017-4/+18
| | | | | | | | | | | | * 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.
* 2012-03-01 Pedro Alves <palves@redhat.com>Pedro Alves2012-03-012-19/+4
| | | | * inferior.c (delete_threads_of_inferior): Delete.
* 2012-03-01 Pedro Alves <palves@redhat.com>Pedro Alves2012-03-012-9/+115
| | | | | | | | | | | | | | 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.
* 2012-03-01 Pedro Alves <palves@redhat.com>Pedro Alves2012-03-013-32/+6
| | | | | * ada-lang.c (ada_modulus_from_name): Delete. * ada-lex.l (lexer_init): Make static.
* * gdb.base/hbreak2.exp: New test for "hbreak" and "thbreak".Maciej W. Rozycki2012-03-012-0/+610
|
* 2012-03-01 Pedro Alves <palves@redhat.com>Pedro Alves2012-03-016-56/+189
| | | | | | | | | | | | | | | | 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.
* * gdb.cp/method2.exp: Output of overload menu is nowKeith Seitz2012-03-014-157/+239
| | | | | | | | | | | | | | | | | | | 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.
* * linespec.c (decode_line_2): Sort the list of methodsKeith Seitz2012-03-012-0/+11
| | | | | alphabetically before presenting the user with a selection menu.
* * gdb.base/help.exp (help show user): Update expected resultKeith Seitz2012-03-012-1/+6
| | | | for new doc string changes (add "non-python").
* * dwarf2read.c (dwarf2_cu): Remove unused members has_form_ref_addr,Doug Evans2012-03-012-26/+7
| | | | | has_namespace_info. (dwarf2_read_abbrevs): Remove corresponding initialization.
* * NEWS: Mention new python command class gdb.COMMAND_USER.Doug Evans2012-03-019-11/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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".
* * valprint.h (struct generic_val_print_decorations): New.Tom Tromey2012-03-018-744/+539
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* * valprint.c (val_print): Update.Tom Tromey2012-03-0118-164/+145
| | | | | | | | | | | | | | | | | | | | | * 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.
* * value.h (val_print): Return void.Tom Tromey2012-03-013-17/+17
| | | | * valprint.c (val_print): Return void.
* * value.h (common_val_print): Return void.Tom Tromey2012-03-013-13/+15
| | | | * valprint.c (common_val_print): Return void.
* * value.h (value_print): Return void.Tom Tromey2012-03-0114-53/+66
| | | | | | | | | | | | | | | | | * 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.
* * value.c (value_primitive_field): Handle virtual base classes.Tom Tromey2012-03-012-2/+13
|
* * gdbtypes.h (struct vbase): Remove.Tom Tromey2012-03-012-7/+4
|
* * c-valprint.c (print_function_pointer_address): Move...Tom Tromey2012-03-015-46/+37
| | | | | | * valprint.c: ... here. Make non-static. * m2-valprint.c (print_function_pointer_address): Remove. * valprint.h (print_function_pointer_address): Declare.
* [NEWS] Document condition at end of catch exception/assert commandsJoel Brobecker2012-03-012-0/+15
| | | | | | | gdb/ChangeLog: * NEWS: Document the fact that one can provide a condition when creating an Ada exception catchpoint.
* * valprint.c (val_print_type_code_flags): Fix placement ofTom Tromey2012-03-012-1/+6
| | | | trailing brace.
* PR ld/13789Hans-Peter Nilsson2012-03-012-1/+6
| | | | * ld-elf/zerosize1.d: Allow xyzzy to be either OBJECT or NOTYPE.
* * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.Cary Coutant2012-03-012-0/+8
|
* Do not set MULTILINE_COMMENT_PREFIXES before calling update-copyrightJoel Brobecker2012-03-012-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.
* Import gnulib's latest update-copyright script...Joel Brobecker2012-03-013-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.
* remove dead code in varobj.c:c_value_of_variableJoel Brobecker2012-03-012-5/+4
| | | | | | gdb/ChangeLog: * varobj.c (c_value_of_variable): Remove dead code.
* * elfxx-tilegx.c (tilegx_elf_relocate_section): Silence bogus warning.Alan Modra2012-03-012-1/+5
|
* *** empty log message ***gdbadmin2012-03-011-1/+1
|
* daily updateAlan Modra2012-02-291-1/+1
|
* * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):Cary Coutant2012-02-297-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.
* [Ada] processId: Do not modify already encoded IDsJoel Brobecker2012-02-292-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.
* ada-lang.c:ada_find_renaming_symbol minor improvement.Joel Brobecker2012-02-294-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.
* Minor cleanup to a couple of functions in ada-lang.c.Joel Brobecker2012-02-293-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.
* [Ada] avoid error message pollution with uninitialized tagged variableJoel Brobecker2012-02-297-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.
* [Ada] New functions to decode Ada types and valuesJoel Brobecker2012-02-293-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.
* [Ada] Fix comment in ada-lang.c:ada_is_ignored_fieldJoel Brobecker2012-02-292-3/+12
| | | | | | | | Fix a comment that completly mistunderstood the code... gdb/ChangeLog: * ada-lang.c (ada_is_ignored_field): Rewrite wrong comment.
* [Ada] Do not cache lookup result if not full_searchJoel Brobecker2012-02-292-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.
* [Ada] print packed arrays indexed by enumerated typeJoel Brobecker2012-02-298-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.
* [Ada] Handle reference to array descriptorsJoel Brobecker2012-02-297-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.
* Ada: ada_to_fixed_value should also unwrap_valueJoel Brobecker2012-02-292-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.
* [Ada] whatis not printing array type name for value from historyJoel Brobecker2012-02-297-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.
* Add support for condition in Ada exception catchpoint commandsJoel Brobecker2012-02-292-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.