aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
AgeCommit message (Collapse)AuthorFilesLines
2013-03-21 PR exp/15109:Tom Tromey3-0/+11
* c-exp.y (yylex): Rewrite to push all tokens onto the FIFO. Handle FILENAME token. gdb/testsuite * gdb.cp/cpexprs.exp: Add test for FILENAME:: case. * gdb.cp/misc.exp: Add test for FILENAME:: case.
2013-03-20Fix PR gdb/15289 - "set remote hardware-watchpoint-limit" broken (zinteger ↵Pedro Alves2-0/+20
commands) This is a regression from 7.5, introduced/exposed by: http://sourceware.org/ml/gdb-patches/2012-07/msg00259.html There are a series of issues with this code. It does: unsigned int val = parse_and_eval_long (arg); ^^^^^^^^^^^^ (unsigned, usually 32-bit) while parse_and_eval_long returns a LONGEST (usually 64-bit), so we lose precision without noticing: (gdb) set remote hardware-watchpoint-limit 0x100000000 (gdb) show remote hardware-watchpoint-limit 0x100000000 The maximum number of target hardware watchpoints is 0. While at it, print the invalid number with plongest, so the user sees what GDB thought the number was: (gdb) set remote hardware-watchpoint-limit 0x100000000 integer 4294967296 out of range So with "set remote hardware-watchpoint-limit -1", val ends converted to 0xffffffff, which then fails the else if (val >= INT_MAX) error (_("integer %u out of range"), val); test. Looking at that INT_MAX check, we forbid INT_MAX itself, but we shouldn't, as that does fit in 'int' -- we want to forbid values _greater_ than INT_MAX (and less than INT_MIN, while at it): (gdb) set remote hardware-watchpoint-limit 2147483647 integer 2147483647 out of range The same problem is in the new var_zuinteger_unlimited code, which also uses "int" for variable. Also, when printing a 'signed int', we should use %d, not %u. This adds a couple regression tests. Not completely thorough in checking all kinds of invalid input; I'm saving more exaustive testing around zXXinteger commands for something like new test-assisting commands like "maint test cmd-zinteger -1", where testing would focus on the command types, and thus be independent of particular user commands of particular GDB features. Tested on x86_64 Fedora 17. gdb/ 2013-03-20 Pedro Alves <palves@redhat.com> PR gdb/15289 * cli/cli-setshow.c (do_set_command) <var_uinteger, var_zuinteger>: Use LONGEST for variable holding the result of parsing the command argument. Throw error if the value is greater than UINT_MAX. Print the invalid value with plongest. <var_integer, var_zinteger>: Use LONGEST for variable holding the result of parsing the command argument. Throw error if the value is greater than INT_MAX, not greater or equal. Also throw error if the value is less than INT_MIN. Print the invalid value with plongest. <var_zuinteger_unlimited>: Throw error if the value is greater than INT_MAX, not greater or equal. (do_show_command) <var_integer, var_zinteger, var_zuinteger_unlimited>: Use %d for printing int, not %u. gdb/testsuite/ 2013-03-20 Pedro Alves <palves@redhat.com> PR gdb/15289 * gdb.base/remote.exp: Test "set remote hardware-watchpoint-limit -1", "set remote hardware-breakpoint-limit -1", "set remote hardware-watchpoint-limit 2147483647" and "set remote hardware-breakpoint-limit 2147483647".
2013-03-20tfile.exp: Test printing a non-const global that is not covered by the trace ↵Pedro Alves3-0/+30
frame; test disassembling. Make sure we don't fallback to printing the initial value of a non-const variable in the executable. Also make sure we can do 'disassemble', as another test that GDB is able to read read-only parts from the executable (the existing test of printing constglob also covers that case). gdb/testsuite/ 2013-03-20 Pedro Alves <palves@redhat.com> Yao Qi <yao@codesourcery.com> * gdb.trace/tfile.c: Add comments. (nonconstglob): New global. * gdb.trace/tfile.exp: Add comments. Test printing a non-const global that is not covered by the trace frame. Test disassembling.
2013-03-17gdb/testsuite/Jan Kratochvil2-0/+11
* gdb.base/valgrind-infcall.exp (continue #$continue_count) <remote connection closed> (continue #$continue_count) <valgrind vgdb has terminated>: Add kill of $valgrind_pid.
2013-03-15 PR c++/15116:Tom Tromey3-0/+10
* gdbtypes.c (types_equal): Handle TYPE_CODE_FUNC. gdb/testsuite * gdb.cp/overload.cc (intintfunc): New. * gdb.cp/overload.exp: Add regression test.
2013-03-15gdb/testsuite/Yao Qi28-2245/+2409
* gdb.threads/non-ldr-exc-1.exp (do_test): Fix the indent of using with_test_prefix. * gdb.threads/non-ldr-exc-2.exp (do_test): Likewise. * gdb.threads/non-ldr-exc-3.exp (do_test): Likewise. * gdb.threads/non-ldr-exc-4.exp (do_test): Likewise. * gdb.threads/watchpoint-fork.exp (test): Likewise. * gdb.base/break-interp.exp (test_core): Likewise. (test_attach_gdb): Likewise. * gdb.base/catch-load.exp (one_catch_load_test): Likewise. * gdb.base/disp-step-syscall.exp (disp_step_cross_syscall): Likewise. * gdb.base/jit-so.exp (one_jit_test): Likewise. * gdb.base/jit.exp (one_jit_test): Likewise. * gdb.base/sepdebug.exp (test_different_dir): Likewise. * gdb.dwarf2/dw2-dir-file-name.exp (test): Likewise. * gdb.dwarf2/dw2-noloc.exp (file_symbols): Likewise. * gdb.mi/mi-breakpoint-changed.exp (test_pending_resolved): Likewise. * gdb.mi/mi-cmd-param-changed.exp (test_command_param_changed): Likewise. * gdb.mi/mi-watch.exp test_watchpoint_all): Likewise. * gdb.mi/pr11022.exp (test_memory_changed_observer): Likewise. * gdb.trace/change-loc.exp (tracepoint_change_loc_1): Likewise. (tracepoint_change_loc_2): Likewise. * gdb.trace/disconnected-tracing.exp (disconnected_tracing): Likewise. (disconnected_tfind): Likewise. * gdb.trace/mi-traceframe-changed.exp (test_tfind_tfile): Likewise. (test_tfind_remote): Likewise. * gdb.trace/mi-tracepoint-changed.exp (test_reconnect): Likewise. (test_pending_resolved): Likewise. * gdb.trace/mi-tsv-changed.exp (test_create_delete_modify_tsv): Likewise. (test_upload_tsv): Likewise. * gdb.trace/pending.exp (pending_tracepoint_resolved): Likewise. (pending_tracepoint_works): Likewise. * gdb.trace/report.exp (use_collected_data): Likewise. * gdb.trace/status-stop.exp (test_tstart_tstop_tstart): Likewise. (test_tstart_tstart, test_buffer_full_tstart): Likewise. * gdb.trace/strace.exp (strace_info_marker): Likewise. (strace_trace_on_same_addr): Likewise. (strace_trace_on_diff_addr): Likewise. * gdb.trace/unavailable.exp (gdb_collect_args_test): Likewise. (gdb_collect_locals_test): Likewise. (gdb_unavailable_registers_test): Likewise. (gdb_collect_globals_test): Likewise.
2013-03-15gdb/testsuite/Yao Qi2-1/+6
* gdb.base/condbreak.exp: Add semicolon back which was removed by my previous commit.
2013-03-14gdb/testsuite/Yao Qi114-256/+365
* config/monitor.exp (gdb_target_cmd): Remove semicolon after 'return'. (gdb_target_monitor, gdb_load): Likewise. * config/sid.exp (gdb_load): Likewise. * config/slite.exp (gdb_load): Likewise. * config/vx.exp (gdb_start, spawn_vxgdb): Likewise. * gdb.ada/arrayidx.exp, gdb.ada/null_array.exp: Likewise. * gdb.arch/mips-octeon-bbit.exp (single_step): Likewise. (single_step_until): Likewise. * gdb.arch/powerpc-d128-regs.exp: Likewise. * gdb.arch/system-gcore.exp: Likewise. * gdb.base/bigcore.exp (extract_heap): Likewise. * gdb.base/break-on-linker-gcd-function.exp: Likewise. * gdb.base/call-ar-st.exp: Likewise. * gdb.base/call-rt-st.exp: Likewise. * gdb.base/call-sc.exp, gdb.base/call-strs.exp: Likewise. * gdb.base/callfuncs.exp, gdb.base/completion.exp: Likewise. * gdb.base/condbreak.exp, gdb.base/constvars.exp: Likewise. * gdb.base/corefile.exp: Likewise. * gdb.base/dbx.exp (gdb_file_cmd): Likewise. * gdb.base/exprs.exp, gdb.base/fileio.exp: Likewise. * gdb.base/fixsection.exp: Likewise. * gdb.base/funcargs.exp: Likewise. * gdb.base/gcore-buffer-overflow.exp: Likewise. * gdb.base/gcore-relro.exp: Likewise. * gdb.base/gcore.exp, gdb.base/gdb11530.exp: Likewise. * gdb.base/gdb11531.exp, gdb.base/gnu-ifunc.exp: Likewise. * gdb.base/info-os.exp, gdb.base/info-proc.exp: Likewise. * gdb.base/interp.exp, gdb.base/langs.exp:: Likewise. * gdb.base/list.exp: Likewise. (set_listsize): Likewise. * gdb.base/logical.exp, gdb.base/mips_pro.exp: Likewise. * gdb.base/miscexprs.exp, gdb.base/nodebug.exp: Likewise. * gdb.base/opaque.exp, gdb.base/pointers.exp: Likewise. * gdb.base/psymtab.exp, gdb.base/ptype.exp: Likewise. * gdb.base/relational.exp, gdb.base/scope.exp: Likewise. * gdb.base/setvar.exp: Likewise. (test_set): Likewise. * gdb.base/signals.exp, gdb.base/sizeof.exp: Likewise. * gdb.base/solib-overlap.exp: Likewise. * gdb.base/store.exp, gdb.base/structs.exp: Likewise. * gdb.base/structs2.exp, gdb.base/volatile.exp: Likewise. * gdb.base/watchpoint.exp (initialize): Likewise. (test_simple_watchpoint): Likewise. (test_disabling_watchpoints): Likewise. (test_watchpoint_triggered_in_syscall): Likewise. * gdb.base/whatis.exp, gdb.cp/ambiguous.exp: Likewise. * gdb.cp/casts.exp, gdb.cp/ctti.exp: Likewise. * gdb.cp/namespace.exp, gdb.cp/nsdecl.exp: Likewise. * gdb.cp/psmang.exp, gdb.dwarf2/dw2-ranges.exp: Likewise. * gdb.hp/gdb.aCC/optimize.exp: Likewise. * gdb.hp/gdb.aCC/watch-cmd.exp: Likewise. * gdb.hp/gdb.base-hp/callfwmall.exp: Likewise. * gdb.hp/gdb.base-hp/pxdb.exp: Likewise. * gdb.hp/gdb.compat/xdb1.exp: Likewise. * gdb.hp/gdb.compat/xdb2.exp: Likewise. * gdb.hp/gdb.compat/xdb3.exp: Likewise. * gdb.hp/gdb.defects/bs14602.exp: Likewise. * gdb.hp/gdb.defects/solib-d.exp: Likewise. * gdb.mi/gdb792.exp: Likewise. * gdb.mi/mi-inheritance-syntax-error.exp: Likewise. * gdb.mi/mi-logging.exp, gdb.mi/mi-var-cp.exp : Likewise. * gdb.mi/mi-var-rtti.exp, gdb.python/py-type.exp: Likewise. * gdb.threads/gcore-thread.exp: Likewise. (load_core): Likewise. * gdb.threads/pthreads.exp (all_threads_running): Likewise. (test_startup, check_control_c): Likewise. * gdb.threads/sigstep-threads.exp: Likewise. * gdb.threads/thread_check.exp: Likewise. * gdb.trace/backtrace.exp, gdb.trace/change-loc.exp: Likewise. * gdb.trace/circ.exp (run_trace_experiment): Likewise. (set_a_tracepoint, trace_buffer_normal): Likewise. (gdb_trace_circular_tests): Likewise. * gdb.trace/collection.exp: Likewise. * gdb.trace/disconnected-tracing.exp: Likewise. * gdb.trace/infotrace.exp: Likewise. * gdb.trace/mi-traceframe-changed.exp: Likewise. * gdb.trace/mi-tracepoint-changed.exp: Likewise. * gdb.trace/mi-tsv-changed.exp (test_create_delete_modify_tsv): Likewise. * gdb.trace/packetlen.exp, gdb.trace/passc-dyn.exp: Likewise. * gdb.trace/pending.exp, gdb.trace/report.exp: Likewise. * gdb.trace/stap-trace.exp: Likewise. * gdb.trace/status-stop.exp,gdb.trace/strace.exp: Likewise. * gdb.trace/tfind.exp, gdb.trace/trace-break.exp: Likewise. * gdb.trace/trace-buffer-size.exp: Likewise. * gdb.trace/tspeed.exp, gdb.trace/tsv.exp: Likewise. * gdb.trace/unavailable.exp: Likewise. * gdb.trace/while-dyn.exp: Likewise. * lib/fortran.exp (set_lang_fortran): Likewise. * lib/gdb.exp (default_gdb_version, gdb_start_cmd): Likewise. (gdb_breakpoint, gdb_reinitialize_dir): Likewise. (default_gdb_start, get_compiler_info): Likewise. (gdb_compile, gdb_compile_objc, gdb_reload, gdb_init): Likewise. (get_debug_format, setup_xfail_format): Likewise. (rerun_to_main, gdb_skip_float_test): Likewise. (build_id_debug_filename_get, get_remotetimeout): Likewise. * lib/java.exp (set_lang_java): Likewise. * lib/mi-support.exp (default_mi_gdb_start): Likewise. (mi_gdb_reinitialize_dir, mi_gdb_target_cmd): Likewise. (mi_gdb_file_cmd, mi_gdb_test): Likewise. (mi_run_cmd_full, mi_expect_interrupt): Likewise. * lib/objc.exp (set_lang_objc): Likewise. * lib/pascal.exp (set_lang_pascal): Likewise. * lib/prompt.exp (default_prompt_gdb_start): Likewise. * lib/trace-support.exp (gdb_trace_setactions, gdb_tfind_test): Likewise. (gdb_readexpr, gdb_gettpnum, gdb_find_recursion_test_baseline): Likewise.
2013-03-14From: Sergio Durigan Junior <sergiodj@redhat.com>Sergio Durigan Junior3-0/+17
Subject: [PATCH] Fix for PR c++/15203 and PR c++/15210 Date: Sat, 09 Mar 2013 02:50:49 -0300 (5 days, 4 hours, 57 minutes ago) Message-ID: <m3a9qdnmti.fsf@redhat.com> Hi, This bug was reported internally at our Bugzilla, along with a proposed fix. After talking to Keith about it, he investigated and came up with another patch needed to really fix the issue on CVS HEAD. The first part of the fix is the patch to cp-namespace.c. It handles the case when we are accessing a static variable inside a function (inside a class) by the full linespec (is it right, Keith?). E.g.: class foo { public: int bar() { static int var = 0; } }; And then, printing the value of `var': (gdb) print 'foo::bar()::var' GDB would fall in an internal_error: gdb/cp-namespace.c:816: internal-error: cp_lookup_nested_symbol called on a non-aggregate type. This is because `cp_lookup_nested_symbol' is not handling the case when TYPE_CODE is either _FUNC or _METHOD. This patch fixes it by returning NULL in this case. The second part of the fix is the patch to elfread.c. It is needed because the BSF_GNU_UNIQUE flag was added to some symbols in <http://sourceware.org/ml/binutils/2009-06/msg00016.html>. Because of that, (still) the command: (gdb) print 'foo::bar()::var' where `var' is a static variable returns: "No symbol "foo::bar()::var" in current context." So with the second patch applied the command finally DTRT: (gdb) print 'foo::bar()::var' $1 = 0 This may not be the ideal solution, according to Keith it would be good to implement productions on c-exp.y in order to recognize CLASS::FUNCTION::VARIABLE, but it is a solution which works with what we have today. I regtested it in Fedora 17 x86_64 with -m64 and -m32, including gdbserver, without regressions. gdb/: 2013-03-14 Keith Seitz <keiths@redhat.com> Alan Matsuoka <alanm@redhat.com> PR c++/15203 PR c++/15210 * cp-namespace.c (cp_lookup_nested_symbol): Handle TYPE_CODE_FUNC and TYPE_CODE_METHOD. * elfread.c (elf_symtab_read): Handle BSF_GNU_UNIQUE for certain symbols. gdb/testsuite/: 2013-03-14 Sergio Durigan Junior <sergiodj@redhat.com> PR c++/15203 PR c++/15210 * gdb.cp/m-static.cc (keepalive_int): New function. (gnu_obj_1::method): New variable `sintvar', call `keepalive_int'. * gdb.cp/m-static.exp: New test for `sintvar'.
2013-03-14gdb/testsuite/Yao Qi2-2/+40
* gdb.trace/tstatus.exp (run_trace_experiment): Save the output of 'tstatus' into tstatus_output. (top level): Save the trace data to tfile. Read trace file in tfile target. Check the trace status.
2013-03-13 * tracepoint.c (tfile_get_trace_state_variable_value): Look forYao Qi2-2/+38
the last matched 'V' blcok in trace frame. gdb/gdbserver: * tracepoint.c (traceframe_read_tsv): Look for the last matched 'V' block in trace frame. gdb/testsuite: * gdb.trace/tsv.exp (check_tsv): New. (top level): Save a tfile on current trace session. Call check_tsv on live target. Load the tfile with target tfile and call check_tsv again.
2013-03-13gdb/testsuite/Yao Qi2-16/+9
2013-03-13 Yao Qi <yao@codesourcery.com> * gdb.trace/tsv.exp: Remove code unrelated to testing TSV. Replace some "gdb_test" with "gdb_test_no_output".
2013-03-12Allow 'thread' to be used as a variable name in expressions.Paul N. Hilfinger5-0/+140
GDB treats the identifiers 'if', 'thread', and 'task' unconditionally as expression delimiters in Ada mode, which is correct for 'if' and 'task', but wrong for 'thread' in cases such as print thread Borrowing from c-exp.y, we observe that 'thread' must be followed by numerals, whereas identifiers never are and treat them as delimiters only in that case. In the process, the current also refactors and incidentally fixes the code for rewinding the input to before the delimiting tokens. For example, the code watch expr if i > 2 fails because the input is only rewound to just before the 'i', leaving the 'if' as part of the expression (and thus making the rest look like trailing junk rather than a conditional clause). gdb/ChangeLog: * ada-lex.l (rules): Only recognize 'thread' as a delimiter when followed by numerals, as for c-exp.y. Use new rewind_to_char function to rewind the input for expression-delimiting tokens. (rewind_to_char): New function. gdb/testsuite/ChangeLog: * gdb.ada/expr_delims.exp: New file. * gdb.ada/expr_delims/foo.adb: New file. * gdb.ada/expr_delims/pck.ads: New file. * gdb.ada/expr_delims/pck.adb: New file.
2013-03-11 * watchpoint.exp (test_no_hw_watchpoints): Add test usingKeith Seitz2-0/+11
both condition and thread. Then delete the watchpoint.
2013-03-11Add tests for the new record-btrace target.Markus Metzger13-4/+730
testsuite/ * Makefile.in: Add btrace testsuite. * configure: Regenerated. * configure.ac: Add btrace testsuite. * gdb.btrace/Makefile.in: New file. * gdb.btrace/enable.c: New file. * gdb.btrace/enable.exp: New file. * gdb.btrace/function_call_history.c: New file. * gdb.btrace/function_call_history.exp: New file. * gdb.btrace/instruction_history.c: New file. * gdb.btrace/instruction_history.exp: New file. * gdb.btrace/instruction_history.S: New file. * lib/gdb.exp: Add btrace skip proc.
2013-03-10gdb/Jan Kratochvil4-0/+783
Fix entry-values if the callee called a noreturn function. * dwarf2-frame-tailcall.c (dwarf2_tailcall_sniffer_first): Use get_frame_address_in_block. Add new comment. gdb/testsuite/ Fix entry-values if the callee called a noreturn function. * gdb.arch/amd64-tailcall-noret.S: New file. * gdb.arch/amd64-tailcall-noret.c: New file. * gdb.arch/amd64-tailcall-noret.exp: New file.
2013-03-10gdb/Jan Kratochvil6-0/+744
Fix entry-values in C++ across CUs. * dwarf2loc.c (call_site_to_target_addr) <FIELD_LOC_KIND_PHYSNAME>: Use lookup_minimal_symbol. Add a comment. * dwarf2read.c (read_call_site_scope) <is_ref_attr> <die_is_declaration>: Prefer DW_AT_linkage_name. gdb/testsuite/ Fix entry-values in C++ across CUs. * gdb.arch/amd64-tailcall-cxx.exp: New file. * gdb.arch/amd64-tailcall-cxx1.S: New file. * gdb.arch/amd64-tailcall-cxx1.cc: New file. * gdb.arch/amd64-tailcall-cxx2.S: New file. * gdb.arch/amd64-tailcall-cxx2.cc: New file.
2013-03-092013-03-09 Hafiz Abid Qadeer <abidh@codesourcery.com>Hafiz Abid Qadeer1-1/+1
Fixed year number in Changelog files.
2013-03-082012-03-08 Stan Shebs <stan@codesourcery.com>Hafiz Abid Qadeer3-0/+152
Hafiz Abid Qadeer <abidh@codesourcery.com> gdb/ * NEWS: Mention set and show trace-buffer-size commands. Mention new packet. * target.h (struct target_ops): New method to_set_trace_buffer_size. (target_set_trace_buffer_size): New macro. * target.c (update_current_target): Set up new method. * tracepoint.c (trace_buffer_size): New global. (start_tracing): Send it to the target. (set_trace_buffer_size): New function. (_initialize_tracepoint): Add new setshow for trace-buffer-size. * remote.c (remote_set_trace_buffer_size): New function. (_initialize_remote): Use it. (QTBuffer:size) New remote command. (PACKET_QTBuffer_size): New enum. (remote_protocol_features): Add an entry for PACKET_QTBuffer_size. gdb/gdbserver/ * tracepoint.c (trace_buffer_size): New global. (DEFAULT_TRACE_BUFFER_SIZE): New define. (init_trace_buffer): Change to one-argument function. Allocate trace buffer memory. (handle_tracepoint_general_set): Call cmd_bigqtbuffer_size to handle QTBuffer:size packet. (cmd_bigqtbuffer_size): New function. (initialize_tracepoint): Call init_trace_buffer with DEFAULT_TRACE_BUFFER_SIZE. * server.c (handle_query): Add QTBuffer:size in the supported packets. gdb/doc/ * gdb.texinfo (Starting and Stopping Trace Experiments): Document trace-buffer-size set and show commands. (Tracepoint Packets): Document QTBuffer:size. (General Query Packets): Document QTBuffer:size. gdb/testsuite/ * gdb.trace/trace-buffer-size.exp: New file. * gdb.trace/trace-buffer-size.c: New file.
2013-03-06tstatus.exp: use UNSUPPORTED for optional features that are not supportedPedro Alves2-20/+31
The current tstatus.exp tests shows PASSes if either the target support or not the optional tstatus bits: PASS: gdb.trace/tstatus.exp: tstatus does not report trace stop reason PASS: gdb.trace/tstatus.exp: tstatus reports trace stop reason The former (and any other similar case) should be UNSUPPORTED rather than PASS. That'd make it much easier to spot actually problems with the test (e.g., the one Yao's previous patch addressed), along with regressions and progressions. The "not supported" paths in tstatus.exp explicitly check for output you'd get if the feature wasn't supported, so real unexpected failures will still be caught as FAILs. So now e.g., where we wanted to check if tstatus reports the trace stop reason, and if the target does support it, we get PASS: tstatus reports trace stop reason if the target actually reports what we'd expect if the trace stop reason isn't supported, we get: UNSUPPORTED: tstatus reports trace stop reason and if the target reports something else unexpected, we get: FAIL: tstatus reports trace stop reason That has the added bonus that the test string is always the same and only the test results change (PASS/FAIL/UNSUPPORTED), which makes it easier for testers see regressions, compared to the previous: -PASS: gdb.trace/tstatus.exp: tstatus reports trace stop reason +PASS: gdb.trace/tstatus.exp: tstatus does not report trace stop reason which clearly easily goes by unnoticed, as evidenced by the existing problem Yao's previous patch addressed. Tested on x86_64 Fedora 17. gdb/testsuite/ 2013-03-06 Pedro Alves <palves@redhat.com> * gdb.trace/tstatus.exp (run_trace_experiment): When the target doesn't support the tested optional feature, call "unsupported" with the same test message as the "pass" case, instead of calling "pass" with a different message. Use the same text for the "fail" cases too.
2013-03-06gdb/testsuite/Yao Qi2-44/+7
* gdb.trace/tstatus.exp: Remove the invocation of gdb_load_shlibs, gdb_compile, clean_restart and runto_main. (test_tracepoints): Don't set fast tracepoint. (top level): Don't check agent library is loaded or not.
2013-03-06gdb/testsuite/Yao Qi2-1/+6
* gdb.trace/tstatus.exp (run_trace_experiment): Escape parentheses by "\\".
2013-03-04gdb/Jan Kratochvil5-3/+122
* linespec.c (struct linespec_canonical_name): New. (struct linespec_state): Change canonical_names type to it. (add_sal_to_sals): Change variable canonical_name to canonical. Change xrealloc element size. Initialize the different CANONICAL fields. (canonical_to_fullform): New. (filter_results): Use it. Add variables canonical, fullform and cleanup. (struct decode_line_2_item, decode_line_2_compare_items): New. (decode_line_2): Remove variables iter and item_names, add variables items and items_count. Modify the code for these new variables. gdb/testsuite/ * gdb.linespec/base/one/thefile.cc (twodup): New. (m): Call it. * gdb.linespec/base/two/thefile.cc (dupname): New. (n): Call it. * gdb.linespec/break-ask.exp: New file. * gdb.linespec/lspec.cc (body_elsewhere): New comment marker.
2013-02-28gdb/gdbserver/Yao Qi2-140/+181
* gdb.trace/report.exp: Move some code to ... (use_collected_data): New. (top level): Call use_collected_data once on the live target. Save at file of the current trace session, load it with target tfile, and call use_collected_data again.
2013-02-27gdb/testsuite/Jan Kratochvil2-0/+6
* gdb.threads/fork-thread-pending.c (main): Add alarm.
2013-02-27gdb/testsuite/Jan Kratochvil2-0/+9
* gdb.base/valgrind-infcall.exp (valgrind_pid): New variable. Add final kill of ${valgrind_pid}.
2013-02-21 Add a new method 'disassemble' to gdb.Architecture class.Siva Chandra Reddy4-1/+86
* python/py-arch.c (archpy_disassmble): Implementation of the new method gdb.Architecture.disassemble. (arch_object_methods): Add entry for the new method. * doc/gdb.texinfo (Architectures In Python): Add description about the new method gdb.Architecture.disassemble. * testsuite/gdb.python/py-arch.c: New test case * testsuite/gdb.python/py-arch.exp: New tests to test gdb.Architecture.disassemble * testsuite/gdb.python/Makefile.in: Add py-arch to the list of EXECUTABLES.
2013-02-18 PR gdb/15102:Tom Tromey2-0/+86
* dwarf2read.c (read_subrange_type): Use result of 'check_typedef'. gdb/testsuite * gdb.dwarf2/subrange.exp: New file.
2013-02-152013-02-15 Pedro Alves <pedro@codesourcery.com>Hafiz Abid Qadeer2-0/+9
Hafiz Abid Qadeer <abidh@codesourcery.com> gdb/ * NEWS: Mention new field "trace-file". * tracepoint.c (trace_status_mi): Output "trace-file" field. (tfile_open): Record the trace file's filename in the trace status. (tfile_files_info): Mention the name of the trace file. Check the "filename" field explicitely. (trace_status_command): Explicitely check "filename" field. (trace_find_command): Ditto. (trace_find_pc_command): Ditto. (trace_find_tracepoint_command): Ditto. (trace_find_line_command): Ditto. (trace_find_range_command): Ditto. (trace_find_outside_command): Ditto. * tracepoint.h (struct trace_status) <from_file>: Rename it to "filename" and make it hold the trace file's filename instead of a boolean. * remote.c (remote_get_trace_status): Initialize "filename" field with NULL instead of 0. gdb/doc/ * gdb.texinfo (GDB/MI Tracepoint Commands) <-trace-status>: Document the "trace-file" field. gdb/testsuite/ * gdb.trace/tfile.exp: Add test for -trace-status command.
2013-02-14gdb/testsuite/Jan Kratochvil2-2/+6
* gdb.threads/pthread_cond_wait.c (main): Remove variable ts. Replace nanosleep by sleep.
2013-02-14Fix ptype bug actually exercised in userdef.expPedro Alves2-1/+5
I happened to notice a bug with ptype &Ref, and found out userdef.exp actually exercises the bug. With: class Container { public: Member m; Member& operator* (); }; Member& Container::operator* () { return this->m; } And 'c' is of type Container: (gdb) p c $1 = {m = {z = -9192}} (gdb) p *c $2 = (Member &) @0x7fffffffda20: {z = -9192} (gdb) ptype *c type = class Member { public: int z; } & (gdb) p &*c $3 = (Member *) 0x7fffffffda20 (gdb) ptype &*c type = class Member { public: int z; } &* (gdb) Notice that last print (&*c) on says the type is a pointer - that's how you get the address behind a reference. But notice the last ptype instead says the type of the same expression is a pointer _reference_. This looks like a bug to me. This patch fixes it. The issue is that we're entering the VALUE_LVAL (x) == lval_memory branch by mistake for references. The fix is just to swap the tests so references are checked first, like value_addr also handles references first. Tested on x86_64 Fedora 17. 2013-02-14 Pedro Alves <palves@redhat.com> * eval.c (evaluate_subexp_for_address) <default_case_after_eval, EVAL_AVOID_SIDE_EFFECTS>: Swap and handle TYPE_CODE_REF before lval_memory. 2013-02-14 Pedro Alves <palves@redhat.com> * gdb.cp/userdef.exp (ptype &*c): Don't expect an &.
2013-02-142013-02-14 Pedro Alves <pedro@codesourcery.com>Hafiz Abid Qadeer2-1/+22
Hafiz Abid Qadeer <abidh@codesourcery.com> gdb/ * tracepoint.h (validate_trace_state_variable_name): Declare. * tracepoint.c (validate_trace_state_variable_name): New. (trace_variable_command): Parse the trace state variable's name without using parse_expression. Do several validations. * mi/mi-main.c (mi_cmd_trace_define_variable): Don't parse the trace state variable's name with parse_expression. Validate it. gdb/testsuite/ * gdb.trace/tsv.exp: Adjust tests, and add a few more.
2013-02-12 PR symtab/11464:Tom Tromey3-0/+14
* c-exp.y (lex_one_token): Initialize other fields of yylval on NAME return. (classify_inner_name): Remove 'first_name' argument, add 'context'. Remove unused variable. (yylex): Explicitly maintain the context type. Exit loop earlier if NAME result is seen. gdb/testsuite * gdb.cp/m-static.cc (gnu_obj_1::~gnu_obj_1): New destructor. * gdb.cp/m-static.exp: Add tests to print quoted destructor.
2013-02-12Update some copyright years.Pedro Alves11-10/+23
Some files managed to get in the tree with outdated copyright years. This fixes it. Applied. gdb/ 2013-02-12 Pedro Alves <palves@redhat.com> * break-catch-sig.c: Update copyright years. gdb/testsuite/ 2013-02-12 Pedro Alves <palves@redhat.com> * gdb.base/catch-signal.c: Update copyright years. * gdb.base/catch-signal.exp: Update copyright years. * gdb.dwarf2/dw2-dir-file-name.c: Update copyright years. * gdb.dwarf2/dw2-dir-file-name.exp: Update copyright years. * gdb.dwarf2/dw2-empty-pc-range.S: Update copyright years. * gdb.dwarf2/dw2-error.S: Update copyright years. * gdb.dwarf2/dw2-error.c: Update copyright years. * gdb.dwarf2/dw2-restrict.S: Update copyright years. * gdb.dwarf2/dw2-restrict.c: Update copyright years. * gdb.dwarf2/dw2-restrict.exp: Update copyright years.
2013-02-12Fix some pastos in the testsuite.Pedro Alves5-4/+12
2013-02-12 Pedro Alves <palves@redhat.com> * gdb.base/catch-signal.exp: Correct test file name in "Skipping" message. * gdb.base/sigaltstack.exp: Ditto. * gdb.base/siginfo.exp: Ditto. * gdb.base/sizeof.exp: Ditto.
2013-02-12Tweak intro comments to some MI test files.Pedro Alves10-67/+39
A while ago I noticed there's some blind copy/pasting going on some test intro comments. This fixes some instances, in the MI testsuite. Tested on x86_64 Fedora 17. testsuite/ 2013-02-12 Pedro Alves <palves@redhat.com> * gdb.mi/mi-basics.exp: Tweak intro comment. * gdb.mi/mi-break.exp: Tweak intro comment. * gdb.mi/mi-console.exp: Tweak intro comment. * gdb.mi/mi-file.exp: Tweak intro comment. * gdb.mi/mi-read-memory.exp: Tweak intro comment. * gdb.mi/mi-return.exp: Tweak intro comment. * gdb.mi/mi-stepi.exp: Tweak intro comment. * gdb.mi/mi-until.exp: Tweak intro comment. * gdb.mi/mi-watch.exp: Tweak intro comment.
2013-02-12Fix whitespace.Pedro Alves1-7/+7
2013-02-12From: Sanimir Agovic <sanimir.agovic@intel.com>Pedro Alves4-1/+92
null ptr check to prevent gdbserver from crashing Evaluating a thread local storage variable in a remote scenario crashes gdbserver if libthread-db could not be loaded. 2013-02-12 Sanimir Agovic <sanimir.agovic@intel.com> gdbserver/ * thread-db.c (thread_db_get_tls_address): NULL pointer check thread_db. testsuite/ * gdb.server/no-thread-db.exp: New file. * gdb.server/no-thread-db.c: New file. * gdb.server/Makefile.in (EXECUTABLES): Add no-thread-db.
2013-02-11 * printcmd.c (printf_c_string,printf_wide_c_string): New functions.Doug Evans2-0/+8
(printf_decfloat): New function. Broken out from ui_printf. Remove unnecessary code to shift the entire format string down. (printf_pointer): New function. (ui_printf): Code to print C strings, wide C strings, decfloats, and pointers moved to separate functions.
2013-02-11gdb/:Sergio Durigan Junior3-0/+47
2013-02-11 Sergio Durigan Junior <sergiodj@redhat.com> * valops.c (value_assign): Handling bitfield offset in `lval_internalvar_component' case. gdb/testsuite/: 2013-02-11 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.base/bitfields.c (struct internalvartest): New declaration. * gdb.base/bitfields.exp (bitfield_internalvar): New function.
2013-02-10gdb/testsuite/Jan Kratochvil2-0/+5
* gdb.python/py-prompt.exp: Add to the end a kill of $testpid.
2013-02-06gdb/doc:Yao Qi2-7/+88
2013-02-06 Yao Qi <yao@codesourcery.com> * gdb.texinfo (GDB/MI Async Records): Document new MI notification "=tsv-modified". Update the document of MI notification "=tsv-created". * observer.texi (GDB Observers): New observer tsv_modified. Update observer tsv_created and tsv_deleted. gdb: 2013-02-06 Yao Qi <yao@codesourcery.com> * mi/mi-interp.c: Include "tracepoint.h". (mi_tsv_modified): Declare. (mi_tsv_created, mi_tsv_deleted): Update declaration. (mi_interpreter_init): Call observer_attach_tsv_modified. (mi_tsv_modified): New. (mi_tsv_created, mi_tsv_deleted): Update. * tracepoint.c (trace_variable_command): Call observer_notify_tsv_modified if the initial value of tsv is changed. (delete_trace_state_variable): Call observer_notify_tsv_deleted earlier. (trace_variable_command): Caller update. (create_tsv_from_upload): Likewise. * observer.sh: Declare "struct trace_state_variable". * NEWS: Mention the new MI notification "=tsv-modified". gdb/testsuite: 2013-02-06 Yao Qi <yao@codesourcery.com> * gdb.trace/mi-tsv-changed.exp (test_create_delete_tsv): Rename to ... (test_create_delete_modify_tsv): ... here. New test on modifying the initial value of a tsv.
2013-02-05gdb/testsuite/Jan Kratochvil2-1/+6
* gdb.dwarf2/dw2-dir-file-name.exp (cd ${srcabsdir}/rdir): Rename to ... (cd .../rdir): ... here.
2013-02-03gdb/Jan Kratochvil5-0/+141
* dwarf2read.c (file_file_name): New function with code from file_full_name. (file_full_name): Move most of the code to file_file_name. (macro_start_file): Rename variable full_name to file_name and use file_file_name for it. Add comp_dir parameter to new_macro_table. * macrocmd.c (show_pp_source_pos): New variable fullname. Replace any macro_source_file->filename access by macro_source_fullname call. * macroscope.c (_initialize_macroscope): Update the new_macro_table caller. * macrotab.c (struct macro_table): New field comp_dir. (macro_include): New variables link_fullname and source_fullname. Replace any macro_source_file->filename access by macro_source_fullname call. (macro_lookup_inclusion): Remove the partial filenames checking code. (check_for_redefinition): New variables source_fullname and found_key_fullname. Replace any macro_source_file->filename access by macro_source_fullname call. (macro_undef): New variables source_fullname and key_fullname. Replace any macro_source_file->filename access by macro_source_fullname call. (macro_lookup_definition): New variables retval and source_fullname. Replace any macro_source_file->filename access by macro_source_fullname call. (foreach_macro): New variable key_fullname. Replace any macro_source_file->filename access by macro_source_fullname call. (foreach_macro_in_scope): New variable datum_fullname. Replace any macro_source_file->filename access by macro_source_fullname call. (new_macro_table): Add parameter comp_dir. Initialize T with it. (macro_source_fullname): New function. * macrotab.h (struct macro_source_file): Extent the filename field comment. (new_macro_table): New parameter comp_dir, add a comment for it. (macro_source_fullname): new declaration. gdb/testsuite/ * gdb.linespec/base/one/header.h: New file. * gdb.linespec/base/two/header.h: New file. * gdb.linespec/macro-relative.c: New file. * gdb.linespec/macro-relative.exp: New file.
2013-02-03gdb/Jan Kratochvil7-0/+189
* dwarf2read.c (dw2_expand_symtabs_matching): Add basenames parameter to the file_matcher parameter. Pass 0 to it. (dwarf2_create_include_psymtab): Copy also DIRNAME. * psymtab.c (partial_map_symtabs_matching_filename): Drop handling of NULL psymtab_to_fullname result. (psymtab_to_fullname): Remove variable r. Never return NULL, assemble an expected filename instead. (expand_symtabs_matching_via_partial): Add basenames parameter to the file_matcher parameter. Call also psymtab_to_fullname, after newly considering BASENAMES_MAY_DIFFER. * source.c (rewrite_source_path): Remove static. * source.h (rewrite_source_path): New declaration. * symfile.h (struct quick_symbol_functions): Add basenames parameter to the expand_symtabs_matching field. Comment it. * symtab.c (file_matches): New function comment. Add parameter basenames, implement it. (search_symbols_file_matches): Add basenames parameter. Update the file_matches caller. (search_symbols): Match FILES also against symtab_to_fullname. Optimize it for BASENAMES_MAY_DIFFER. gdb/testsuite/ * gdb.base/fullpath-expand-func.c: New file. * gdb.base/fullpath-expand.c: New file. * gdb.base/fullpath-expand.exp: New file. * gdb.base/realname-expand-real.c: New file. * gdb.base/realname-expand.c: New file. * gdb.base/realname-expand.exp: New file.
2013-02-03gdb/Jan Kratochvil3-0/+492
Add a new variable that controls a way in which filenames are displayed. * NEWS (set filename-display): New entry. * source.c (filename_display_basename, filename_display_relative) (filename_display_absolute, filename_display_kind_names) (filename_display_string, show_filename_display_string) (symtab_to_filename_for_display): New. (_initialize_source): Added initialization of 'filename-display' variable. * source.h (symtab_to_filename_for_display): Added declaration. * stack.c (print_frame): Added new variable and calling of a new function and condition with this variable. Changed third argument of calling of a function. gdb/doc/ * gdb.texinfo (Backtrace): Added description of 'filename-display' variable in 'set/show backtrace' section. gdb/testsuite/ * gdb.dwarf2/dw2-dir-file-name.exp: New file. * gdb.dwarf2/dw2-dir-file-name.c: New file.
2013-02-03gdb/Jan Kratochvil2-0/+21
Code cleanup. * breakpoint.c (clear_command): Remove variable is_abs, unify the call of filename_cmp with compare_filenames_for_search. * dwarf2read.c (dw2_map_symtabs_matching_filename): Remove variable is_abs, unify the call of FILENAME_CMP with compare_filenames_for_search. New gdb_asserts for real_path and name. Unify the call of compare_filenames_for_search with FILENAME_CMP. * psymtab.c (partial_map_symtabs_matching_filename): Likewise. * symfile.h (struct quick_symbol_functions): Extend the comment for map_symtabs_matching_filename. * symtab.c (compare_filenames_for_search): Remove the function comment relative path requirement. Handle absolute filenames, with a comment. (iterate_over_some_symtabs): Remove variable is_abs, unify the call of FILENAME_CMP with compare_filenames_for_search. New gdb_asserts for real_path and name. Unify the call of compare_filenames_for_search with FILENAME_CMP. (iterate_over_symtabs): New gdb_assert on REAL_PATH. gdb/testsuite/ * gdb.mi/mi-fullname-deleted.exp: Use double last slash for $srcfileabs. (compare_filenames_for_search does not match) (compare_filenames_for_search does match): New tests.
2013-02-03gdb/Jan Kratochvil2-7/+11
Replace xfullpath calls by gdb_realpath calls. * cli/cli-cmds.c (find_and_open_script): Remove xfullpath from the function comment. * dwarf2read.c (dw2_map_expand_apply): Remove parameter full_path. Remove it from the iterate_over_some_symtabs call. (dw2_map_symtabs_matching_filename): Remove parameter full_path. Remove it from the dw2_map_expand_apply calls, remove a block handling it. * psymtab.c (partial_map_expand_apply): Remove parameter full_path. Remove it from the iterate_over_some_symtabs call. (partial_map_symtabs_matching_filename): Remove parameter full_path. Remove it from the partial_map_expand_apply calls, remove a block handling it. Drop gdb_realpath call and cleanups from the real_path handling. * source.c (openp): Drop the comment part about xfullpath. Replace xfullpath calls by gdb_realpath calls. (find_and_open_source): Replace xfullpath call by gdb_realpath call. * symfile.h (struct quick_symbol_functions): Remove parameter full_path from method map_symtabs_matching_filename and its comment. * symmisc.c (maintenance_print_msymbols): Replace xfullpath call by gdb_realpath call. * symtab.c (iterate_over_some_symtabs): Remove parameter full_path, remove it also from the function comment, remove a block handling it. Drop gdb_realpath call and cleanups from the real_path handling. (iterate_over_symtabs): Drop variable full_path and its use. * symtab.h (iterate_over_some_symtabs): Remove parameter full_path. * utils.c (xfullpath): Remove. * utils.h (xfullpath): Remove. gdb/testsuite/ * gdb.gdb/xfullpath.exp: Replace xfullpath calls by gdb_realpath calls.
2013-02-02gdb/testsuite/Jan Kratochvil2-1/+5
* lib/java.exp (compile_java_from_source): Initialize ARGS as a list.
2013-02-01gdb/Jan Kratochvil2-3/+26
* elfread.c (elf_symfile_read): Limit separate debug info additions to files with no separate debug info. * objfiles.c (add_separate_debug_objfile): Add gdb_assert calls. * symfile.c (read_symbols): Call find_separate_debug_file_in_section only for files with no separate debug info. gdb/testsuite/ * gdb.base/gnu-debugdata.exp): Create ${binfile}.debug, ${binfile}.mini_debuginfo-debuglink, add -k to xz, use now ${binfile}.mini_debuginfo-debuglink and ${binfile}.mini_debuginfo-debuglink.xz.