aboutsummaryrefslogtreecommitdiff
path: root/gdb
AgeCommit message (Collapse)AuthorFilesLines
2014-04-09[GDBserver] Fix SH/Linux build.Pedro Alves2-1/+6
sh-linux-gnu-gcc (...) src/gdb/gdbserver/linux-low.c .../src/gdb/gdbserver/linux-low.c: In function 'linux_read_loadmap': .../src/gdb/gdbserver/linux-low.c:5284:13: error: 'struct lwp_info' has no member named 'entry' make[1]: *** [linux-low.o] Error 1 gdb/gdbserver/ 2014-04-09 Pedro Alves <palves@redhat.com> * linux-low.c (linux_read_loadmap): Pass current_inferior directly to lwpid_of.
2014-04-09darwin: fix thinko (free thread port after threads are discovered).Tristan Gingold2-4/+30
Due to a thinko, a message could be not understood and ignored. The result was a dead-lock (gdb is waiting for an event that never happen). The port of the thread was deallocated before new threads are discovered. As a consequence, the origin of the message was unknown (instead of being linked to the newly created thread). gdb/ * darwin-nat.c (darwin_check_new_threads): Fix port leak, add comments. (darwin_decode_exception_message): Free port only after use.
2014-04-08Fix erroneous backtrace on avrxmega architectures.Pierre Langlois2-1/+14
* avr-tdep.c (struct gdbarch_tdep): Mention avrxmega in the comment. (avr_gdbarch_init): Add xmega architectures given by bfd_architecture when setting the size of call_length.
2014-04-08[testsuite] Disable Ctrl-V use for mingw hosts.Pierre Muller2-2/+15
On mingw host, we have seen two fails as below, p int1dim[0]^V@2 Invalid character '^V' in expression. (gdb) FAIL: gdb.base/printcmds.exp: p int1dim[0]@2 p int1dim[0]^V@2^V@3 Invalid character '^V' in expression. (gdb) FAIL: gdb.base/printcmds.exp: p int1dim[0]@2@3 In the test, the comment says "# Send \026@ instead of just @ in case the kill character is @". Historically, kill character was @, and Ctrl-V (\026) is to escape the next character. However, we don't have to do so on mingw. This patch is to disable ctrl-v usage on mingw hots. With this patch applied, it becomes: p int1dim[0]@2 $607 = {0, 1} (gdb) PASS: gdb.base/printcmds.exp: p int1dim[0]@2 p int1dim[0]@2@3 $608 = {{0, 1}, {2, 3}, {4, 5}} Note that this patch is picked from Pierre's submission, [RFC 6/6] Fix remaining failures in gdb.base/printcmds.exp for mingw hosts. https://www.sourceware.org/ml/gdb-patches/2013-09/msg00943.html gdb/testsuite: 2014-04-08 Pierre Muller <muller@sourceware.org> * gdb.base/printcmds.exp (test_artificial_arrays): Disable Ctrl-V use for mingw hosts.
2014-04-07[python] Fix gdb.Value.dynamic_type for reference values.Siva Chandra5-1/+18
gdb.Value.dynamic_type is supposed to work for reference and pointer values. However, the value object in the function 'valpy_get_dynamic_type' was being dereferenced using 'value_ind' irrespective of the value type being TYPE_CODE_PTR or TYPE_CODE_REF. This patch fixes that to use 'coerce_ref' for TYPE_CODE_REF values. ChangeLog: * python/py-value.c (valpy_get_dynamic_type): Use coerce_ref to dereference TYPE_CODE_REF values. testsuite/ * gdb.python/py-value.c: Improve test case. * gdb.python/py-value.exp: Add new test.
2014-04-07Add support to recognize clang.Doug Evans3-0/+13
* lib/compiler.c: Identify the clang compiler. * lib/compiler.cc: Ditto.
2014-04-07Fix ARI warning in darwin-nat.c::darwin_decode_messageJoel Brobecker2-1/+6
gdb/ChangeLog: * darwin-nat.c (darwin_decode_message): Remove trailing '\n' at end of warning message.
2014-04-03(read_cutu_die_from_dwo): Update function comment to match previous change.Doug Evans1-2/+2
2014-04-03 * dwarf2read.c (read_cutu_die_from_dwo): Fix assertion, at most oneDoug Evans2-2/+7
of stub_comp_unit_die, stub_comp_dir is non-NULL.
2014-04-03Escape backslash in windows pathYao Qi2-2/+6
Hi, On windows host, we see the following ERROR, (gdb) PASS: gdb.base/setshow.exp: set history filename ~/foobar.baz ERROR OCCURED: couldn't compile regular expression pattern: invalid escape \ seq uence while executing "expect -nobrace -i exp13 -timeout 10 -re {.*A problem internal to GDB has been detected} { fail "$message (GDB internal error)" gdb_internal..." invoked from within "expect { -i exp13 -timeout 10 -re ".*A problem internal to GDB has been detected" { fail "$message (GDB internal error)" gdb_internal_erro..." ("uplevel" body line 1) invoked from within "uplevel $body" REGEXP REG_EESCAPE {invalid escape \ sequence} couldn't compile regular expression pattern: invalid escape \ sequenceERROR: Process no longer ex ists which leads to UNRESOLVED: gdb.base/setshow.exp: show history filename (~/foobar.baz) and this error is thrown from this test below: gdb_test "show history filename" \ "The filename in which to record the command history is \"$HOME/foobar.baz\"..*" \ "show history filename (~/foobar.baz)" HOME is a windows path, like C:\foo\bar. When it is used in gdb_test to match output, the error is thrown because backslash is a special character in regular expression. This patch is to escape backslash to fix this error by using string_to_regexp. gdb/testsuite: 2014-04-03 Yao Qi <yao@codesourcery.com> * gdb.base/setshow.exp: Invoke string_to_regexp to HOME and PWD.
2014-04-02Handle VDSO section headers past end of pageAlan Modra2-7/+39
When a VDSO gets large enough that it doesn't entirely fit in one page, but not so large that the part described by the program header exceeds one page, then gdb/BFD doesn't read the section headers and symbol table information. This patch cures that by passing the size of the vdso to BFD, and fixes a number of other issues in the BFD code. bfd/ * elfcode.h (bfd_from_remote_memory): Add "size" parameter. Consolidate code handling possible section headers past end of segment. Don't use p_align for page size guess, instead use minpagesize. Take note of ld.so clearing section headers when p_memsz > p_filesz. Handle file header specifying no section headers. Handle zero p_align throughout. Default loadbase to zero. Add comments. Rename contents_size to high_offset, and make it a bfd_vma. Delete unnecessary bfd_set_error calls. * bfd-in.h (bfd_elf_bfd_from_remote_memory): Update prototpe. * elf-bfd.h (struct elf_backend_data <elf_backend_from_remote_memory>): Likewise. (_bfd_elf32_bfd_from_remote_memory): Likewise. (_bfd_elf64_bfd_from_remote_memory): Likewise. * elf.c (bfd_elf_bfd_from_remote_memory): Adjust. * bfd-in2.h: Regnerate. gdb/ * symfile-mem.c (symbol_file_add_from_memory): Add size parameter. Pass to bfd_elf_bfd_from_remote_memory. Adjust all callers. (struct symbol_file_add_from_memory_args): Add size field. (find_vdso_size): New function. (add_vsyscall_page): Attempt to find vdso size.
2014-04-01* dwarf2read.c (read_cutu_die_from_dwo): Improve comment.Doug Evans2-3/+9
2014-04-01darwin-nat: avoid crash while debugging gdb.Tristan Gingold2-54/+98
it is possible that gdb gets mach exceptions from an unknown inferior. This happens when an inferior creates a child and that child gets a signal. So instead of reporting messages with unknown origins, simply reply to these notifications. The kernel will then post the unix signal. gdb/ * darwin-nat.c (darwin_encode_reply): Add prototype. (darwin_decode_exception_message): Reply to unknown inferiors. (darwin_decode_message): Handle message by id. Ignore message to unknown inferior. (darwin_wait): Discard unknown messages, add debug trace.
2014-04-01gdb.arch/ppc64-atomic-inst.exp: Improve error handling.Anton Blanchard2-7/+12
gdb/testsuite/ 2014-04-01 Anton Blanchard <anton@samba.org> * gdb.arch/ppc64-atomic-inst.exp: Use untested. Make test messages unique.
2014-04-01gdb.arch/ppc64-atomic-inst.exp: Use standard_testfile, prepare_for_testing.Anton Blanchard2-11/+7
gdb/testsuite/ 2014-04-01 Anton Blanchard <anton@samba.org> * gdb.arch/ppc64-atomic-inst.exp: Use standard_testfile, prepare_for_testing.
2014-04-01Fix ppc64 single step over atomic sequence testcase.Anton Blanchard4-48/+78
The current ppc64 single step over atomic sequence testcase is written in C and breaks with some versions of gcc. Convert the test to assembly and use stepi to step through it. gdb/testsuite/ 2014-04-01 Anton Blanchard <anton@samba.org> * gdb.arch/ppc64-atomic-inst.c: Remove. * gdb.arch/ppc64-atomic-inst.S: New file. * gdb.arch/ppc64-atomic-inst.exp: Adapt for asm based testcase.
2014-03-31dwarf2read.c (read_cutu_die_from_dwo): Delete unused local comp_dir_string.Doug Evans2-1/+5
2014-03-31New option "set print symbol-loading".Doug Evans11-2/+321
* NEWS: Mention it. * solib.c (solib_read_symbols): Only print symbol loading messages if requested. (solib_add): If symbol loading is in "brief" mode, notify user symbols are being loaded. (reload_shared_libraries_1): Ditto. * symfile.c (print_symbol_loading_off): New static global. (print_symbol_loading_brief): New static global. (print_symbol_loading_full): New static global. (print_symbol_loading_enums): New static global. (print_symbol_loading): New static global. (print_symbol_loading_p): New function. (symbol_file_add_with_addrs): Only print symbol loading messages if requested. (_initialize_symfile): Register "print symbol-loading" set/show command. * symfile.h (print_symbol_loading_p): Declare. doc/ * gdb.texinfo (Symbols): Document set/show print symbol-loading. testsuite/ * gdb.base/print-symbol-loading-lib.c: New file. * gdb.base/print-symbol-loading-main.c: New file. * gdb.base/print-symbol-loading.exp: New file.
2014-03-31Allow ';' as a directory separatorYao Qi2-2/+6
Hi, I find two fails in source-dir.exp on mingw32 host. (gdb) directory /nOtExStInG/a /nOtExStInG/b /nOtExStInG/c^M Warning: /nOtExStInG/a: No such file or directory.^M Warning: /nOtExStInG/b: No such file or directory.^M Warning: /nOtExStInG/c: No such file or directory.^M Source directories searched: /nOtExStInG/a;/nOtExStInG/b;/nOtExStInG/c;$cdir;$cwd^M (gdb) FAIL: gdb.base/source-dir.exp: directory /nOtExStInG/a /nOtExStInG/b /nOtExStInG/c directory /nOtExStInG/b /nOtExStInG/d /nOtExStInG/c^M Warning: /nOtExStInG/b: No such file or directory.^M Warning: /nOtExStInG/d: No such file or directory.^M Warning: /nOtExStInG/c: No such file or directory.^M Source directories searched: /nOtExStInG/b;/nOtExStInG/d;/nOtExStInG/c;/nOtExStInG/a;$cdir;$cwd^M (gdb) FAIL: gdb.base/source-dir.exp: directory /nOtExStInG/b /nOtExStInG/d /nOtExStInG/c The regular expression expects ':' and ';' is path separator on Windows. This patch is to allow ';' as a path separator in regular expression. This patch is similar to Dan's patch to fix a similar problem here Re: directory separators on minGW hosts https://sourceware.org/ml/gdb-patches/2006-02/msg00359.html It is obvious. Pushed it in. gdb/testsuite: 2014-03-31 Yao Qi <yao@codesourcery.com> * gdb.base/source-dir.exp: Allow ';' as a directory separator.
2014-03-30 * infrun.c (set_last_target_status): New function.Doug Evans2-2/+15
(handle_inferior_event): Call it.
2014-03-30* inferior.h (enum stop_kind): Improve comment.Doug Evans2-8/+12
2014-03-30 * gdb.texinfo (Non-Stop Mode): Remove trailing whitespace.Doug Evans2-18/+23
(Background Execution): Ditto.
2014-03-28[varobj] false type-changed status for reference to Ada arrayJoel Brobecker7-1/+147
Given the following variable... BT : Bounded := New_Bounded (Low => 1, High => 3); ... where type Bounded is defined as a simple unconstrained array: type Bounded is array (Integer range <>) of Integer; Creating a varobj for that variable, and immediately asking for varobj updates, GDB says that our varobj changed types! (gdb) -var-create bt * bt ^done,name="bt",numchild="3",value="[3]",type="<ref> array (1 .. 3) of integer",has_more="0" (gdb) -var-update 1 * ^done,changelist=[{name="bt",value="[3]",in_scope="true",type_changed="true",new_type="<ref> array (1 .. 3) of integer",new_num_children="3",has_more="0"}] The expected output for the -var-update command is, in this case: (gdb) -var-update 1 * ^done,changelist=[] The problem occurs because the ada-varobj module does not handle references, and while the references gets stripped when the varobj gets created, it doesn't when computing varobj updates. More specifically, when creating the varobj, varobj_create creates a new value which is a reference to a TYPE_CODE_ARRAY. It then calls install_new_value which calls coerce_ref with the following comment: /* We are not interested in the address of references, and given that in C++ a reference is not rebindable, it cannot meaningfully change. So, get hold of the real value. */ if (value) value = coerce_ref (value); This leaves the varobj's type component still a ref, while the varobj's value is now our array, without the ref. This explains why the "value" field in the varobj indicates an array with 3 elements "[3]" while the "type" field shows a ref to an array. Generally speaking, most users have said that showing the ref was a useful piece of information, so this patch is not touching this part. Next, when the user issues the -var-update request, varobj_update calls value_of_root to compute the varobj's new value as well as determine whether the value's type has changed or not. What happens in a nutshell is that it calls value_of_root_1 (which re-evaluates the expression and returns the corresponding new value), finds that the new value is not NULL, and thus asks whether it has mutated: else if (varobj_value_has_mutated (var, value, value_type (value))) This then indirectly delegates the determination to the language-specific callback, which fails, because it does not handle references. This patch fixes the issue by adjusting varobj_value_has_mutated to expect references, and strip them when seen. This allows the various language-specific implementations to remain unaware of references. gdb/ChangeLog: * varobj.c (varobj_value_has_mutated): If NEW_VALUE is a reference, strip the reference layer before calling the lang_ops value_has_mutated callback. gdb/testsuite/ChangeLog: * gdb.ada/mi_dyn_arr: New testcase.
2014-03-27Remove `expout*' globals from parser-defs.hSergio Durigan Junior31-1548/+2038
This commit removes the "expout*" globals from our parser code, turning them into a structure that is passed when an expression needs to be evaluated. This is the initial step to make our parser less "globalized". This is mostly a mechanical patch, which creates a structure containing the "expout*" globals and then modify all the functions that handle them in order to take the structure as argument. It is big, and has been reviewed at least 4 times, so I think everything is covered. Below you can see the message links from the discussions: - First attempt: <https://sourceware.org/ml/gdb-patches/2012-01/msg00522.html> Message-ID: <m3k44s7qej.fsf@gmail.com> - Second attempt: <https://sourceware.org/ml/gdb-patches/2012-06/msg00054.html> Message-Id: <1338665528-5932-1-git-send-email-sergiodj@redhat.com> - Third attempt: <https://sourceware.org/ml/gdb-patches/2014-01/msg00949.html> Message-Id: <1390629467-27139-1-git-send-email-sergiodj@redhat.com> - Fourth (last) attempt: <https://sourceware.org/ml/gdb-patches/2014-03/msg00546.html> Message-Id: <1395463432-29750-1-git-send-email-sergiodj@redhat.com> gdb/ 2014-03-27 Sergio Durigan Junior <sergiodj@redhat.com> Remove some globals from our parser. * language.c (unk_lang_parser): Add "struct parser_state" argument. * language.h (struct language_defn) <la_parser>: Likewise. * parse.c (expout, expout_size, expout_ptr): Remove variables. (initialize_expout): Add "struct parser_state" argument. Rewrite function to use the parser state. (reallocate_expout, write_exp_elt, write_exp_elt_opcode, write_exp_elt_sym, write_exp_elt_block, write_exp_elt_objfile, write_exp_elt_longcst, write_exp_elt_dblcst, write_exp_elt_decfloatcst, write_exp_elt_type, write_exp_elt_intern, write_exp_string, write_exp_string_vector, write_exp_bitstring, write_exp_msymbol, mark_struct_expression, write_dollar_variable): Likewise. (parse_exp_in_context_1): Use parser state. (insert_type_address_space): Add "struct parser_state" argument. Use parser state. (increase_expout_size): New function. * parser-defs.h: Forward declare "struct language_defn" and "struct parser_state". (expout, expout_size, expout_ptr): Remove extern declarations. (parse_gdbarch, parse_language): Rewrite macro declarations to accept the parser state. (struct parser_state): New struct. (initialize_expout, reallocate_expout, write_exp_elt_opcode, write_exp_elt_sym, write_exp_elt_longcst, write_exp_elt_dblcst, write_exp_elt_decfloatcst, write_exp_elt_type, write_exp_elt_intern, write_exp_string, write_exp_string_vector, write_exp_bitstring, write_exp_elt_block, write_exp_elt_objfile, write_exp_msymbol, write_dollar_variable, mark_struct_expression, insert_type_address_space): Add "struct parser_state" argument. (increase_expout_size): New function. * utils.c (do_clear_parser_state): New function. (make_cleanup_clear_parser_state): Likewise. * utils.h (make_cleanup_clear_parser_state): New function prototype. * aarch64-linux-tdep.c (aarch64_stap_parse_special_token): Update calls to write_exp* in order to pass the parser state. * arm-linux-tdep.c (arm_stap_parse_special_token): Likewise. * i386-tdep.c (i386_stap_parse_special_token_triplet): Likewise. (i386_stap_parse_special_token_three_arg_disp): Likewise. * ppc-linux-tdep.c (ppc_stap_parse_special_token): Likewise. * stap-probe.c (stap_parse_register_operand): Likewise. (stap_parse_single_operand): Likewise. (stap_parse_argument_1): Likewise. (stap_parse_argument): Use parser state. * stap-probe.h: Include "parser-defs.h". (struct stap_parse_info) <pstate>: New field. * c-exp.y (parse_type): Rewrite to use parser state. (yyparse): Redefine to c_parse_internal. (pstate): New global variable. (parse_number): Add "struct parser_state" argument. (write_destructor_name): Likewise. (type_exp): Update calls to write_exp* and similars in order to use parser state. (exp1, exp, variable, qualified_name, space_identifier, typename, typebase): Likewise. (write_destructor_name, parse_number, lex_one_token, classify_name, classify_inner_name, c_parse): Add "struct parser_state" argument. Update function to use parser state. * c-lang.h: Forward declare "struct parser_state". (c_parse): Add "struct parser_state" argument. * ada-exp.y (parse_type): Rewrite macro to use parser state. (yyparse): Redefine macro to ada_parse_internal. (pstate): New variable. (write_int, write_object_renaming, write_var_or_type, write_name_assoc, write_exp_op_with_string, write_ambiguous_var, type_int, type_long, type_long_long, type_float, type_double, type_long_double, type_char, type_boolean, type_system_address): Add "struct parser_state" argument. (exp1, primary, simple_exp, relation, and_exp, and_then_exp, or_exp, or_else_exp, xor_exp, type_prefix, opt_type_prefix, var_or_type, aggregate, aggregate_component_list, positional_list, others, component_group, component_associations): Update calls to write_exp* and similar functions in order to use parser state. (ada_parse, write_var_from_sym, write_int, write_exp_op_with_string, write_object_renaming, find_primitive_type, write_selectors, write_ambiguous_var, write_var_or_type, write_name_assoc, type_int, type_long, type_long_long, type_float, type_double, type_long_double, type_char, type_boolean, type_system_address): Add "struct parser_state" argument. Adjust function to use parser state. * ada-lang.c (parse): Likewise. * ada-lang.h: Forward declare "struct parser_state". (ada_parse): Add "struct parser_state" argument. * ada-lex.l (processInt, processReal): Likewise. Adjust all calls to both functions. * f-exp.y (parse_type, parse_f_type): Rewrite macros to use parser state. (yyparse): Redefine macro to f_parse_internal. (pstate): New variable. (parse_number): Add "struct parser_state" argument. (type_exp, exp, subrange, typebase): Update calls to write_exp* and similars in order to use parser state. (parse_number): Adjust code to use parser state. (yylex): Likewise. (f_parse): New function. * f-lang.h: Forward declare "struct parser_state". (f_parse): Add "struct parser_state" argument. * jv-exp.y (parse_type, parse_java_type): Rewrite macros to use parser state. (yyparse): Redefine macro for java_parse_internal. (pstate): New variable. (push_expression_name, push_expression_name, insert_exp): Add "struct parser_state" argument. (type_exp, StringLiteral, Literal, PrimitiveType, IntegralType, FloatingPointType, exp1, PrimaryNoNewArray, FieldAccess, FuncStart, MethodInvocation, ArrayAccess, PostfixExpression, PostIncrementExpression, PostDecrementExpression, UnaryExpression, PreIncrementExpression, PreDecrementExpression, UnaryExpressionNotPlusMinus, CastExpression, MultiplicativeExpression, AdditiveExpression, ShiftExpression, RelationalExpression, EqualityExpression, AndExpression, ExclusiveOrExpression, InclusiveOrExpression, ConditionalAndExpression, ConditionalOrExpression, ConditionalExpression, Assignment, LeftHandSide): Update calls to write_exp* and similars in order to use parser state. (parse_number): Ajust code to use parser state. (yylex): Likewise. (java_parse): New function. (push_variable): Add "struct parser_state" argument. Adjust code to user parser state. (push_fieldnames, push_qualified_expression_name, push_expression_name, insert_exp): Likewise. * jv-lang.h: Forward declare "struct parser_state". (java_parse): Add "struct parser_state" argument. * m2-exp.y (parse_type, parse_m2_type): Rewrite macros to use parser state. (yyparse): Redefine macro to m2_parse_internal. (pstate): New variable. (type_exp, exp, fblock, variable, type): Update calls to write_exp* and similars to use parser state. (yylex): Likewise. (m2_parse): New function. * m2-lang.h: Forward declare "struct parser_state". (m2_parse): Add "struct parser_state" argument. * objc-lang.c (end_msglist): Add "struct parser_state" argument. * objc-lang.h: Forward declare "struct parser_state". (end_msglist): Add "struct parser_state" argument. * p-exp.y (parse_type): Rewrite macro to use parser state. (yyparse): Redefine macro to pascal_parse_internal. (pstate): New variable. (parse_number): Add "struct parser_state" argument. (type_exp, exp1, exp, qualified_name, variable): Update calls to write_exp* and similars in order to use parser state. (parse_number, yylex): Adjust code to use parser state. (pascal_parse): New function. * p-lang.h: Forward declare "struct parser_state". (pascal_parse): Add "struct parser_state" argument. * go-exp.y (parse_type): Rewrite macro to use parser state. (yyparse): Redefine macro to go_parse_internal. (pstate): New variable. (parse_number): Add "struct parser_state" argument. (type_exp, exp1, exp, variable, type): Update calls to write_exp* and similars in order to use parser state. (parse_number, lex_one_token, classify_name, yylex): Adjust code to use parser state. (go_parse): Likewise. * go-lang.h: Forward declare "struct parser_state". (go_parse): Add "struct parser_state" argument.
2014-03-27 * dwarf2read.c (read_str_index): Delete arg cu. All callers updated.Doug Evans2-4/+8
2014-03-27 * dwarf2read.c (init_cutu_and_read_dies_no_follow): Fix comments.Doug Evans2-12/+15
Remove argument abbrev_section. All callers updated.
2014-03-27 * dwarf2read.c (struct dwarf2_cu): Improve comments for membersDoug Evans2-2/+7
addr_base, ranges_base.
2014-03-27 * gdb.dwarf2/dw2-abs-hi-pc.exp: Build tests with "nodebug".Doug Evans2-1/+5
2014-03-27Return zero in can_single_step_to_signal_handler for nios2-*-* targetYao Qi2-1/+7
nios2 uses software single step, so GDB is unable to single step to the signal handler. In order to reflect this, teach can_single_step_to_signal_handler to return zero for nios2 target. gdb/testsuite: 2014-03-27 Yao Qi <yao@codesourcery.com> * lib/gdb.exp (can_single_step_to_signal_handler): Return zero if target is nios2-*-*.
2014-03-26Remove VAR_DOMAIN/STRUCT_DOMAIN ambiguity from ada-tasks.c.Keith Seitz2-6/+11
2014-03-26 Keith Seitz <keiths@redhat.com> * ada-tasks.c (get_tcb_types_info): Search STRUCT_DOMAIN for types, not VAR_DOMAIN.
2014-03-26Skip tests on completion and readline when readline lib isn't usedYao Qi10-136/+198
The completion feature and other features on readline depend on the readline library. However, readline library is not always used, for example, running testsuite like make check RUNTESTFLAGS="--host_board=local-remote-host" the input stream is not a tty, and GDB doesn't use readline library as a result. This patch is to skip tests on completion and readline if 'show editing' is off, which means readline isn't used. Note that some tests in gdb.base/completion.exp test command complete, which isn't related to readline, so these tests aren't affected by readline library. This patch also moves these tests up, run them unconditionally, and run the rest if readline library is used. gdb/testsuite: 2014-03-26 Yao Qi <yao@codesourcery.com> * lib/gdb.exp (readline_is_used): New proc. * gdb.base/completion.exp: Move tests on command complete up. Skip the rest of tests if readline is not used. * gdb.ada/complete.exp: Skp the test if readline is not used. * gdb.base/filesym.exp: Likewise. * gdb.base/macscp.exp: Likewise. * gdb.base/readline-ask.exp: Likewise. * gdb.base/readline.exp: Likewise. * gdb.python/py-cmd.exp: Likewise. * gdb.trace/tfile.exp: Likewise.
2014-03-26Fix code format issues gdb.base/macscp.expYao Qi2-48/+56
When I do something else, I find code format in gdb.base/macscp.exp is messy. This patch is to fix various code format issues in it. Pushed as it is obvious. gdb/testsuite: 2014-03-26 Yao Qi <yao@codesourcery.com> * gdb.base/macscp.exp: Fix code format issues.
2014-03-25Fix type of "fp" and other registers for Nios II.Sandra Loosemore4-12/+19
2014-03-25 Sandra Loosemore <sandra@codesourcery.com> gdb/ * features/nios2-cpu.xml: Correct types of "gp", "fp", "ea", and "ra" registers. * features/nios2-linux.c: Regenerated. * features/nios2.c: Regenerated.
2014-03-25Support gdb.asm/asm-source.exp on powerpc64leUlrich Weigand3-0/+57
Add new powerpc64le.inc file appropriate for the ELFv2 ABI and use it to support the asm-source.exp test case on powerpc64le. gdb/testsuite/ 2014-03-25 Ulrich Weigand <uweigand@de.ibm.com> * gdb.asm/asm-source.exp: Handle powerpc64le-* targets. * gdb.asm/powerpc64le.inc: New file.
2014-03-25"source", foreground execution commands, and target-asyncPedro Alves6-0/+110
Sourcing a GDB script that runs foreground execution commands in succession fails if the target can async: Breakpoint 1, main () at ../../../src/gdb/testsuite/gdb.base/source-execution.c:36 36 func1 (); (gdb) source ../../../src/gdb/testsuite/gdb.base/source-execution.gdb ../../../src/gdb/testsuite/gdb.base/source-execution.gdb:21: Error in sourced command file: Cannot execute this command while the selected thread is running. (gdb) FAIL: gdb.base/source-execution.exp: source source-execution.gdb That is, after a foreground execution command, GDB moves on to the following command immediately before waiting for the previous command to complete. https://sourceware.org/ml/gdb-patches/2011-09/msg00037.html (b4a14fd0) addressed this for command lists, Python's gdb.execute, etc., but missed "source". Fixed now in the same way. gdb/ 2014-03-25 Pedro Alves <palves@redhat.com> * cli/cli-script.c (script_from_file): Force the interpreter to sync mode. gdb/testsuite/ 2014-03-25 Pedro Alves <palves@redhat.com> Doug Evans <dje@google.com> * gdb.base/source-execution.c: New file. * gdb.base/source-execution.exp: New file. * gdb.base/source-execution.gdb: New file.
2014-03-24gdb.linespec/macro-relative.exp: Mark the test as unsupported if using fission.Doug Evans2-0/+11
2014-03-24Fix PR breakpoints/16101: gdb.base/dprintf.exp agent-printf failures with ↵Hui Zhu4-34/+77
non-Z0-supporting gdbservers After a previous patch that was committed by Pedro (0000e5cc), trying to set a dprintf with with a GDBserver that doesn't support agent commands at all now throws an error. But the dprintf tests still fail with some GDBserver targets because they doesn't try to handle the case of the server reporting support for breakpoint commands, but not be able to use those in combination with Z0 (because Z0 isn't actually supported, for example): FAIL: gdb.base/dprintf.exp: 1st dprintf, agent FAIL: gdb.base/dprintf.exp: 2nd dprintf, agent FAIL: gdb.base/dprintf.exp: dprintf info 2 (pattern 4) Similarly for the MI test. This patch makes the tests handle this scenario. Tested with native, and native gdbserver on x86_64 Fedora 17. Also tested with the native-gdbserver.exp board hacked with: set GDBFLAGS "${GDBFLAGS} -ex \"set remote breakpoint-commands off\"" (actually, "set remote breakpoint-commands off" is presently broken, so this was on top of a fix for that command.) which results in: (gdb) PASS: gdb.base/dprintf.exp: 2nd dprintf, gdb set dprintf-style agent warning: Target cannot run dprintf commands, falling back to GDB printf warning: Target cannot run dprintf commands, falling back to GDB printf (gdb) UNSUPPORTED: gdb.base/dprintf.exp: set dprintf style to agent gdb.sum: Running target native-gdbserver Running ../../../src/gdb/testsuite/gdb.base/dprintf.exp ... PASS: gdb.base/dprintf.exp: dprintf PASS: gdb.base/dprintf.exp: dprintf foo PASS: gdb.base/dprintf.exp: dprintf 29 PASS: gdb.base/dprintf.exp: dprintf foo,"At foo entry\n" PASS: gdb.base/dprintf.exp: ignore $bpnum 1 PASS: gdb.base/dprintf.exp: dprintf 26,"arg=%d, g=%d\n", arg, g PASS: gdb.base/dprintf.exp: dprintf info 1 PASS: gdb.base/dprintf.exp: break 27 PASS: gdb.base/dprintf.exp: 1st dprintf, gdb PASS: gdb.base/dprintf.exp: 2nd dprintf, gdb UNSUPPORTED: gdb.base/dprintf.exp: set dprintf style to agent PASS: gdb.base/dprintf.exp: Set dprintf style to an unrecognized type And also with the native-gdbserver.exp board hacked with: set GDBFLAGS "${GDBFLAGS} -ex \"set remote Z-packet off\"" which results in: (gdb) continue Continuing. Warning: Cannot insert breakpoint 3: Target doesn't support breakpoints that have target side commands. Cannot insert breakpoint 4: Target doesn't support breakpoints that have target side commands. (gdb) UNSUPPORTED: gdb.base/dprintf.exp: 1st dprintf, agent gdb.sum: Running target native-gdbserver Running ../../../src/gdb/testsuite/gdb.base/dprintf.exp ... PASS: gdb.base/dprintf.exp: dprintf PASS: gdb.base/dprintf.exp: dprintf foo PASS: gdb.base/dprintf.exp: dprintf 29 PASS: gdb.base/dprintf.exp: dprintf foo,"At foo entry\n" PASS: gdb.base/dprintf.exp: ignore $bpnum 1 PASS: gdb.base/dprintf.exp: dprintf 26,"arg=%d, g=%d\n", arg, g PASS: gdb.base/dprintf.exp: dprintf info 1 PASS: gdb.base/dprintf.exp: break 27 PASS: gdb.base/dprintf.exp: 1st dprintf, gdb PASS: gdb.base/dprintf.exp: 2nd dprintf, gdb PASS: gdb.base/dprintf.exp: set dprintf style to agent UNSUPPORTED: gdb.base/dprintf.exp: 1st dprintf, agent PASS: gdb.base/dprintf.exp: Set dprintf style to an unrecognized type (One of the new comments mentions breakpoint always-inserted mode. Actually testing with breakpoint always-inserted mode fails these dprintf tests, due to the way they are written. But that'll take a more substancial rewrite of the tests, so I'm leaving that for another day.) gdb/testsuite/ 2014-03-24 Hui Zhu <hui@codesourcery.com> Pedro Alves <palves@redhat.com> PR breakpoints/16101 * gdb.base/dprintf.exp: Use unsupported rather than changing the test pass/fail messages. Detect missing support for dprintf when breakpoints are actually inserted. * gdb.base/mi-dprintf.exp: Detect missing support for dprintf when breakpoints are actually inserted. * lib/mi-support.exp (mi_run_cmd_full): Return -1 if continue fails.
2014-03-24testsuite: Remove needless linux-nat requirement in gdb-sigterm.exp.Jan Kratochvil2-1/+4
That "set debug lin-lwp 1" command even is not needed for the functionality of this testcase. This patch does fix a testcase error on aarch64-none-elf. gdb/testsuite/ 2014-03-24 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.base/gdb-sigterm.exp (do_test): Remove "set debug lin-lwp 1". Message-ID: <20140323165745.GA23830@host2.jankratochvil.net>
2014-03-24Fix PR/16720Pierre Langlois2-1/+6
2014-03-24 Pierre Langlois <pierre.langlois@embecosm.com> * avr-tdep.c (avr_scan_prologue): Accept push r1 instruction for small stack allocation.
2014-03-24darwin-nat.c: fix dump of messages on x86_64.Tristan Gingold2-18/+22
gdb/ * darwin-nat.c (exc_server): Remove unused prototype. (darwin_dump_message): Correctly display data on x86_64. (darwin_encode_reply): Fix style. Add comments and fix indentation.
2014-03-24Fix typo in previous entry.Pierre Langlois1-1/+1
2014-03-24Add myself as a write-after-approval mainainer.Pierre Langlois2-0/+5
2014-03-21 Pierre Langlois <pierre.langlois@embecosm.com> * MAINTAINERS (Write After Approval): Add "Pierre Langlois".
2014-03-22* infcmd.c: Whitespace fixes.Doug Evans2-2/+14
(interrupt_command): Merge two function comments into one.
2014-03-22* infcmd.c (interrupt_command): Renamed from interrupt_target_command.Doug Evans2-2/+7
2014-03-22Remove target_read_live_memoryYao Qi4-63/+22
As we move code on reading unavailable memory to target side, GDB core side doesn't need the "switching momentarily out of tfind mode" dance. The target remote knows how to read live memory (through remote_ops). Remove set_traceframe_number and make_cleanup_restore_traceframe_number, since they are no longer used. gdb: 2014-03-22 Yao Qi <yao@codesourcery.com> * remote.c (target_read_live_memory): Remove. (memory_xfer_live_readonly_partial): Rename it to remote_xfer_live_readonly_partial. Remove argument 'object'. All callers updated. Call remote_read_bytes_1 instead of target_read_live_memory. * tracepoint.c (set_traceframe_number): Remove. (make_cleanup_restore_traceframe_number): Likewise . * tracepoint.h (set_traceframe_number): Remove declaration. (make_cleanup_restore_traceframe_number): Likewise.
2014-03-22Factor remote_read_bytes.Yao Qi2-43/+60
This patch moves code in remote_read_bytes on reading from the remote stub to a new function remote_read_bytes_1. gdb: 2014-03-22 Yao Qi <yao@codesourcery.com> * remote.c (remote_read_bytes): Move code on reading from the remote stub to ... (remote_read_bytes_1): ... here. New function.
2014-03-22Move the traceframe_available_memory code from memory_xfer_partial_1 down to ↵Yao Qi5-143/+185
the targets As a follow-up to [PATCH 7/8] Adjust read_value_memory to use to_xfer_partial https://sourceware.org/ml/gdb-patches/2014-02/msg00384.html this patch moves traceframe_available_memory down to the target side. After this patch, the gdb core code is cleaner, and code on handling unavailable memory is moved to remote/tfile/ctf targets. In details, this patch moves traceframe_available_memory code from memory_xfer_partial_1 to remote target only, so remote target still uses traceframe_info mechanism to check unavailable memory, and use remote_ops to read them from read-only sections. We don't use traceframe_info mechanism for tfile and ctf target, because it is fast to iterate all traceframes from trace file, so the summary information got from traceframe_info is not necessary. This patch also moves two functions to remote.c from target.c, because they are only used in remote.c. I'll clean them up in another patch. gdb: 2014-03-22 Yao Qi <yao@codesourcery.com> * ctf.c (ctf_xfer_partial): Check the return value of exec_read_partial_read_only, if it is not TARGET_XFER_OK, return TARGET_XFER_UNAVAILABLE. * tracefile-tfile.c (tfile_xfer_partial): Likewise. * target.c (target_read_live_memory): Move it to remote.c. (memory_xfer_live_readonly_partial): Likewise. (memory_xfer_partial_1): Move some code to remote_read_bytes. * remote.c (target_read_live_memory): Moved from target.c. (memory_xfer_live_readonly_partial): Likewise. (remote_read_bytes): New, factored out from memory_xfer_partial_1.
2014-03-22Fix typo in previous entry.Doug Evans1-1/+1
2014-03-22 * gdb.guile/guile.exp (guile not supported): Verify multi-lineDoug Evans2-0/+9
guile command issues an error.
2014-03-22 * extension.c (eval_ext_lang_from_control_command): Avoid dereferencingDoug Evans4-1/+19
NULL pointer. testsuite/ * gdb.python/python.exp (python not supported): Verify multi-line python command issues an error.