The skip test currently relies on the order of evaluation of
arguments which is not defined. Use the comma operator where
order is defined instead.
gdb/testsuite/ChangeLog:
2013-06-18 Will Newton <will.newton@linaro.org>
* gdb.base/skip.c: Use comma to evaluate results of foo()
and bar() before passing to baz().
* gdb.base/skip.c: baz() now takes one argument instead of
two.
PR symtab/15391 is a failure with the DW_OP_GNU_implicit_pointer
feature.
I tracked it down to a logic error in read_pieced_value. The code
truncates this_size_bits according to the type size and offset too
early -- it should do it after taking bits_to_skip into account.
This patch fixes the bug.
While testing this, I also tripped across a latent bug because
indirect_pieced_value does not sign-extend where needed. This patch
fixes this bug as well.
Finally, Pedro pointed out that a previous version implemented sign
extension incorrectly. This version introduces a new gdb_sign_extend
function for this. A couple of notes on this function:
* It has the gdb_ prefix to avoid clashes with various libraries that
felt free to avoid proper namespacing. There is a "sign_extend"
function in a Tile GX header, in an SOM-related BFD header (and in
sh64-tdep.c and as a macro in arm-wince-tdep.c, but those are
ours...)
* I looked at all the sign extensions in gdb and didn't see ones that
I felt comfortable converting to use this function; in large part
because I don't have a good way to test the conversion.
Built and regtested on x86-64 Fedora 18. New test cases included;
this required a minor addition to the DWARF assembler. Note that the
DWARF CU made by implptrpiece.exp uses a funny pointer size in order
to show the sign-extension bug on all platforms.
* dwarf2loc.c (read_pieced_value): Truncate this_size_bits
after taking bits_to_skip into account. Sign extend byte_offset.
* utils.h (gdb_sign_extend): Declare.
* utils.c (gdb_sign_extend): New function.
* gdb.dwarf2/implptrpiece.exp: New file.
* gdb.dwarf2/implptrconst.exp (d): New variable.
Print d.
* lib/dwarf2.exp (Dwarf::_location): Handle DW_OP_piece.
python-selftest.exp fails with an error when using the
native-gdbserver.exp board.
The bug is that the selftest code doesn't work in this situation. It
never has.
This patch fixes the problem by pushing the needed check into
do_self_tests. This helps prevent the problem in the future.
* lib/selftest-support.exp (do_self_tests): Reject remote or
non-native targets.
* gdb.gdb/complaints.exp: Remove check.
* gdb.gdb/observer.exp: Remove check.
* gdb.gdb/xfullpath.exp: Remove check.
* gdb.gdb/complaints.exp: Remove check.
glob.
The current glob missed gnueabihf targets. Expand to catch these
cases and fix the test failure on those systems.
gdb/testsuite/ChangeLog:
2013-06-07 Will Newton <will.newton@linaro.org>
* gdb.base/long_long.exp: Fix ARM EABI target glob.
in output.
There should be an empty line between "post-prompt" and "starting".
This fixes a testsuite failure on ARM.
gdb/testsuite/ChangeLog:
2013-06-07 Will Newton <will.newton@linaro.org>
* gdb.cp/annota2.exp: Add empty line between "post-prompt"
and "starting".
The ARM C++ ABI defines constructors and destructors to return
pointers to this. The C++ tests that check the types of constructors
and destructors expect a return type of void. Conditionalize these
tests so they pass on ARM.
gdb/testsuite/ChangeLog:
2013-06-07 Will Newton <will.newton@linaro.org>
* gdb.cp/anon-struct.exp: Conditionalize constructor and
destructor prototypes for ARM ABI.
* gdb.cp/m-static.exp: Likewise.
* cp-namespace.c (find_symbol_in_baseclass): Call
cp_lookup_symbol_in_namespace instead of cp_lookup_symbol_namespace.
Check result of call to lookup_symbol_static.
Call lookup_static_symbol_aux unconditionally.
Call check_typedef on base types before accessing them.
(cp_lookup_nested_symbol): Fix comment.
testsuite/
* gdb.cp/derivation2.cc: New file.
* gdb.cp/derivation.cc (main): Call foo2.
* gdb.cp/derivation.exp: Add tests for typedefs in another
file, and when there's an active block.
Gary Benson <gbenson@redhat.com>
* lib/gdb.exp (build_executable_from_specs): Use gdb_compile_pthread,
gdb_compile_shlib or gdb_compile_shlib_pthreads where appropriate.
* lib/prelink-support.exp (build_executable_own_libs): Allow INTERP
to be set to "no" to indicate that no ld.so copy should be made.
* gdb.base/break-interp.exp (solib_bp): New constant.
(reach_1): Use the above instead of "_dl_debug_state".
(test_attach): Likewise.
(test_ld): Likewise.
* gdb.threads/dlopen-libpthread.exp: New file.
* gdb.threads/dlopen-libpthread.c: Likewise.
* gdb.threads/dlopen-libpthread-lib.c: Likewise.
* gdb.base/solib-corrupted.exp: Disable test if GDB is using probes.
* mi/mi-cmds.c (mi_cmds): Define MI command
'-exec-arguments' by macro DEF_MI_CMD_CLI_1 instead of
DEF_MI_CMD_CLI.
gdb/testsuite/
* gdb.mi/mi-cmd-param-changed.exp (test_command_param_changed):
Add a test that no MI notification is emitted when executing
-exec-arguments.
PR testsuite/12649
* gdb.mi/mi-dprintf.exp (mi_continue_dprintf) (mi 2nd dprintf): Replace
$mi_gdb_prompt expectation by mi_expect_stop.
(mi 1st dprintf, agent, mi 2nd dprintf, agent)
(mi info dprintf second time): Replace them by mi_send_resuming_command
and mi_expect_stop.
* tracepoint.c (TFILE_PID): Remove.
(tfile_open): Don't add thread and inferior.
(tfile_close): Don't set 'inferior_ptid'. Don't call
exit_inferior_silent.
(tfile_thread_alive): Remove.
(init_tfile_ops): Don't set field 'to_thread_alive' of
tfile_ops.
gdb/testsuite/
* gdb.trace/tfile.exp: Test inferior and thread.
* gdb.base/range-stepping.exp: Skip the rest of tests if the
test fails.
* lib/range-stepping-support.exp (exec_cmd_expect_vCont_count):
Return 0 if the test passes, otherwise return 1.
This adds tests to verify range stepping is used as expected, by
inspecting the RSP traffic, looking for vCont;s and vCont;r packets.
gdb/testsuite/
2013-05-23 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
* gdb.base/range-stepping.c: New file.
* gdb.base/range-stepping.exp: New file.
* gdb.trace/range-stepping.c: New file.
* gdb.trace/range-stepping.exp: New file.
* lib/range-stepping-support.exp: New file.
* c-valprint.c (c_value_print): Use value_addr for
references. Convert back to reference type with value_ref.
gdb/testsuite
* gdb.cp/class2.cc (main): New local 'aref'.
* gdb.cp/class2.exp: Check printing of 'aref'.
This makes sure that the types of the arguments are taken into account
when performing an inferior function call to a non-C (or C-like)
function. In particular, this makes sure that the arguments are
appropriatly converted to the correct type.
For instance, on x86_64-linux, with the following Ada code:
procedure Set_Float (F : Float) is
begin
Global_Float := F;
end Set_Float;
The following sequence shows that Float arguments are incorrectly
passed (Ada's Float type is the equivalent of type "float" in C):
(gdb) call set_float (2.0)
(gdb) print global_float
$1 = 0.0
Putting a breakpoint inside set_float to inspect the value of
register xmm0 gives the first hint of the problem:
(gdb) p $xmm0
$2 = (v4_float => (0 => 0.0, 2.0, 0.0, 0.0),
v2_double => (0 => 2.0, 0.0),
[...]
It shows that the argument was passed as a double.
The code responsible for doing appropriate type conversions
for the arguments (value_arg_coerce) found that our function
was not prototyped, and thus could not use typing information
for the arguments. Instead, it defaulted to the value of "set
coerce-float-to-double", which by default is true, to determine
the argument type.
This patch fixes the problem by setting the PROTOTYPE flag
for all functions of any language except C and Objective C.
gdb/ChangeLog:
* dwarf2read.c (prototyped_function_p): New function.
(read_subroutine_type): Use it.
gdb/testsuite/ChangeLog:
* gdb.ada/float_param: New testcase.
expand-symtabs, and renamed check-psymtabs.
* psymtab.c (maintenance_check_psymtabs): Renamed from
maintenance_check_symtabs. Only process already-expanded symbol
tables.
(_initialize_psymtab): Update.
* symmisc.c (maintenance_check_symtabs): New function.
(maintenance_expand_name_matcher): New function
(maintenance_expand_file_matcher): New function
(maintenance_expand_symtabs): New function.
(_initialize_symmisc): Add "mt check-symtabs" and "mt expand-symtabs"
commands.
doc/
* gdb.texinfo (Maintenance Commands): Update doc for
"maint check-psymtabs". Add doc for "maint check-symtabs",
"maint expand-symtabs".
testsuite/
* gdb.base/maint.exp: Update test for "maint check-psymtabs".
Add tests for "maint check-symtabs", "maint expand-symtabs".
This results in an internal-warning when trying the completion
when in Ada mode:
(gdb) b simple<TAB>
/[...]/cleanups.c:265: internal-warning: restore_my_cleanups has found a stale cleanup
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)
gdb/ChangeLog:
* ada-lang.c (ada_make_symbol_completion_list): Make sure
all cleanups are done before returning from this function.
gdb/testsuite/ChangeLog:
* gdb.ada/complete.exp: Add test verifying completion using
the "tab" key.
* eval.c (evaluate_subexp_standard) <STRUCTOP_STRUCT,
STRUCTOP_PTR>: Return a not_lval value for
EVAL_AVOID_SIDE_EFFECTS.
* opencl-lang.c (evaluate_subexp_opencl): Return a not_lval value
for EVAL_AVOID_SIDE_EFFECTS.
gdb/testsuite
* gdb.base/exprs.exp (test_expr): Add regression test.
* gdb.base/exprs.c (null_t_struct): New global.
I saw some test cases in gdb.base/default.exp and gdb.base/setshow.exp
are enabling the history saving.
Hence .gdb_history file is modified with history information even
though, by default, we have History saving disabled.
So we should modify GDB test cases so that history saving should stay
off for all test cases.
ChangeLog:
2013-05-13 Muhammad Bilal <mbilal@codesourcery.com>
* gdb.base/default.exp: Disable history saving.
* gdb.base/setshow.exp: Likewise.
In the function remote_trace_set_readonly_regions in gdb/remote.c, the
local variable 'offset' does not account for "QTro" at the start of
the packet with the result that if there are any read-only regions,
the packet is sent -- but without the "QTro" -- causing the remote
stub to report that the packet is unsupported:
Sending packet: $:0000000000400200,(...),00000000004560a4#ab...Packet received:
vs the expected:
Sending packet: $QTro:0000000000400200,(...),00000000004560a4#31...Packet received: OK
We don't see the problem when testing with GDBserver, as that supports
qXfer:trace-frame-info:read, meaning GDBserver never needs to read
from the read-only sections directly itself. This commit adds a test
that explicitly disables qXfer:trace-frame-info:read.
gdb/
2013-05-10 David Taylor <dtaylor@emc.com>
PR remote/15455
* remote.c (remote_trace_set_readonly_regions): Do not overwrite
"QTro" at start of packet.
gdb/testsuite/
2013-05-10 Pedro Alves <palves@redhat.com>
PR remote/15455
* gdb.trace/qtro.c: New file.
* gdb.trace/qtro.exp: New file.
* gdb.trace/circ.exp: Remove unnecessary 'if then' checks.
(set_a_tracepoint): Set tracepoint before prologue.
(run_trace_experiment): Test setup_tracepoints and 'break end'
in it.
(trace_buffer_normal): Remove.
(gdb_trace_circular_tests): Remove. Move tests to...
(top level): ...here. Call 'runto_main' before checking for
trace support. Use commands to check the support for circular
trace buffer and changing of trace buffer size. Add test
to calculate size of single frame. Use this size to
calculate the size of trace buffer. Use 'tfind pc func9'
instead of 'tfind 9'. Use 'with_test_prefix'.
The test case gdb.arch/system-gcore.exp is almost an identical copy of
gdb.base/gcore.exp. The only functional change is the additional
comparison of the "info reg system" command output.
It should be safe to perform this comparison on all architectures.
Thus the patch removes the arch-specific version and adds "info reg
system" to the common gcore test case instead.
Tested on i686-linux and s390x-linux.
gdb/testsuite/Changelog:
2013-05-07 Andreas Arnez <arnez@linux.vnet.ibm.com>
* gdb.arch/system-gcore.exp: Remove.
* gdb.arch/gcore.c: Remove.
* gdb.base/gcore.exp: Add "info reg system".
2013-05-07 Sergio Durigan Junior <sergiodj@redhat.com>
PR breakpoints/15413:
* breakpoint.c (condition_completer): Simplify the code to
disconsider multiple locations of breakpoints when completing the
"condition" command.
gdb/testsuite/
2013-05-07 Sergio Durigan Junior <sergiodj@redhat.com>
PR breakpoints/15413:
* gdb.base/pending.exp: Add test for completion of the "condition"
command for pending breakpoints.
* gdb.linespec/linespec.ex: Add test for completion of the
"condition" command when dealing with multiple locations.