aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
AgeCommit message (Collapse)AuthorFilesLines
2013-11-07Fix email address in earlier entry.Doug Evans1-1/+1
2013-11-07PR 11786Doug Evans3-0/+122
* solib-svr4.c (svr4_exec_displacement): Ignore filesz, memsz, flags and align fields for PT_GNU_RELRO segments. testsuite/ * gdb.base/gcore-relro-pie.c: New file. * gdb.base/gcore-relro-pie.exp: New file.
2013-11-072013-11-07 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon3-4/+72
PR python/15747 * python/py-cmd.c: Add COMPLETE_EXPRESSION constant. 2013-11-07 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/py-cmd.exp: Add COMPLETE_EXPRESSION tests. * gdb.python/py-cmd.c: New File. 2013-11-07 Phil Muldoon <pmuldoon@redhat.com> * gdb.texinfo (Commands In Python): Document COMPLETE_EXPRESSION constant.
2013-11-072013-11-07 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon2-0/+38
* python/py-breakpoint.c (bppy_get_temporary): New function. (bppy_init): New keyword: temporary. Parse it and set breakpoint to temporary if True. 2013-11-07 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/py-breakpoint.exp: Add temporary breakpoint tests. 2013-11-07 Phil Muldoon <pmuldoon@redhat.com> * gdb.texinfo (Breakpoints In Python): Document temporary option in breakpoint constructor, and add documentation to the temporary attribute.
2013-11-06 * gdb.python/py-arch.exp: Tweak test name for bad memory access test.Doug Evans2-1/+5
2013-11-06Test on solib load and unloadYao Qi5-0/+260
This patch is to add a test case to on the performance of GDB handling load and unload of shared library. In V4: - Handle malloc and dlopen failure, - Document test parameters. In V3, there are some changes, - Adapt to perf test framework changes. - Measure load and unload separately. In V2, there are some changes, - A new proc gdb_produce_source to produce source files. I tried to move all source file generation code out of solib.exp, but compilation step still needs to know the generated file names. I have to hard-code the file names in compilation step, which is not good to me, so I give up on this moving. - SOLIB_NUMBER -> SOLIB_COUNT - New variable SOLIB_DLCLOSE_REVERSED_ORDER to control the order of iterating a list of shared libs to dlclose them. - New variable GDB_PERFORMANCE to enable these perf test cases. - Remove dlsym call in solib.c. - Update solib.py for the updated framework. gdb/testsuite/ * lib/gdb.exp (gdb_produce_source): New procedure. * gdb.perf/solib.c: New. * gdb.perf/solib.exp: New. * gdb.perf/solib.py: New.
2013-11-06Mention perf test in testsuite/READMEYao Qi2-0/+31
gdb/testsuite: 2013-11-06 Yao Qi <yao@codesourcery.com> * README: Mention performance tests.
2013-11-06Perf test frameworkYao Qi7-0/+491
This patch adds a basic framework to do performance testing for GDB. perftest.py is about the test case, testresult.py is about test results, and how are they saved. reporter.py is about how results are reported (in what format). measure.py is about measuring the execution of tests by a collection of measurements. In V5: - Simplify perftest.exp. In V4: - Rename MeasurementCPUTime to MeasurementCpuTime, - Add 'pass' in empty method, - Simplify string comparison in perftest.exp. - Rename GDB_PERFORMANCE to GDB_PERFTEST_MODE and rename GDB_PERFORMANCE_TIMEOUT to GDB_PERFTEST_TIMEOUT. In V3, there are some changes, - Add wall time measurement, cpu time measurement and vmsize measurement. - Rename SingleStatisticTestCase to TestCaseWithBasicMeasurements, which measures cpu time, wall time, and memory (vmsize). - GDB_PERFORMANCE=run|compile|both to control the mode of perf testing. - New GDB_PERFORMANCE_TIMEOUT to specify the timeout. - Split proc prepare to proc compile and startup. - Disable GC while doing measurements. In V2, there are several changes to address Doug and Sanimir's comments. - Add copyright header and docstring in perftest/__init__.py - Remove config.py. - Fix docstring format. - Rename classes "SingleVariable" to "SingleStatistic". - Don't extend gdb.Function in class TestCase. Add a new method run to run the test case so that we can pass parameters to test. - Allow to customize whether to warm up and to append test log. - Move time measurement into test harness. Add a new class Measurement for a specific measurement and a new class Measure to measure them for a given test case. - A new class ResultFactory to create instances of TestResult. - New file lib/perftest.exp, which is to do some preparations and cleanups to simplify each *.exp file. - Skip compilation step if GDB_PERFORMANCE_SKIP_COMPILE is set. gdb/testsuite/ 2013-11-06 Yao Qi <yao@codesourcery.com> * lib/perftest.exp: New. * gdb.perf/lib/perftest/__init__.py: New. * gdb.perf/lib/perftest/measure.py: New. * gdb.perf/lib/perftest/perftest.py: New. * gdb.perf/lib/perftest/reporter.py: New. * gdb.perf/lib/perftest/testresult.py: New.
2013-11-06New make target 'check-perf' and new dir gdb.perfYao Qi5-2/+29
We add a new dir gdb.perf in testsuite for all performance tests. However, current 'make check' logic will either run dejagnu in directory testsuite or iterate all gdb.* directories which has *.exp files. Both of them will run tests in gdb.perf. We want to achieve: 1) typical 'make check' should not run performance tests. In each perf test case, GDB_PERFTEST_MODE is checked. If it doesn't exist, return. 2) run perf tests easily. We add a new makefile target 'check-perf'. gdb: 2013-11-06 Yao Qi <yao@codesourcery.com> * Makefile.in (check-perf): New target. gdb/testsuite: 2013-11-06 Yao Qi <yao@codesourcery.com> * Makefile.in (check-perf): New target. * configure.ac (AC_OUTPUT): Output Makefile in gdb.perf. * configure: Re-generated. * gdb.perf/Makefile.in: New.
2013-11-04switch to fully parallel modeTom Tromey2-58/+56
This switches "make check" to fully parallel mode. One primary issue facing full parallelization is the overhead of "runtest". On my machine, if I "touch gdb.base/empty.exp", making a new file, and then "time runtest.exp", it takes 0.08 seconds. Multiply this by the 1008 (in my configuration) tests and you get ~80 seconds. This is the overhead that would theoretically be present if all tests were run in parallel. However, the problem isn't nearly as bad as this, for two reasons. First, you must divide by the number of jobs, assuming perfect parallelization -- reasonably true for small -j numbers, based on the results I see. Second, the current test suite parallelization approach bundles the tests, largely by directory, but also splitting up gdb.base into two halves. I was curious to see how the current bundling played out in practice, so I ran "make -j1 check RUNTEST='/bin/time runtest'". This invokes the parallel mode (thus the bundling) and then shows the time taken by each invocation of runtest. Then, I ran "/bin/time make -j3 check". (See below about -j2.) The time for the entire -j3 test run was the same as the time for "gdb.base1". What this means is that gdb.base1 is currently the time-limiting run, preventing further parallelization gains. So, I reason, whatever overhead we see from full parallelization will only be seen by "-j1" and "-j2". I then tried a -j2 test run. This does take longer than a -j3 build, meaning that the gdb.base1 job finishes and then proceeds to other runtest invocations. Finally I tried a -j2 test run with the appended patch. This was 9% slower than the -j2 run without the patch. I think that is a reasonable slowdown for what is probably a rare case. I believe this patch will yield faster test results for all -j values greater than 2. For -j3 on my machine, the test suite is a few seconds faster; I didn't try any larger -j values. For -j1, I went ahead and changed the Makefile so that, if no -j option is given, then the "check-single" mode is used. You can still use "make -j1 check" to get single-job parallel-mode, though of course there's no good reason to do so. This change is likely to speed up the plain "make check" scenario a little as we will now bypass dg-extract-results.sh. One drawback of this change is that "make -jN check" is now much more verbose. I generally only look at the .sum and .log files, but perhaps this will bother some. Another interesting question is scalability of the result. The slowest test, which limits the scalability, took 80.78 seconds. The mean of the remaining tests is 1.08 seconds. (Note that this is just a rough estimate, since there are still outliers.) This means we can run 80.78 / 1.08 =~ 74 tests in the time available. And, in this data set (slightly older than the above, but materially the same) there were 948 tests. So, I think the current test suite should scale ok up to about -j12. We could improve this number if need be by breaking up the biggest tests. 2013-11-04 Tom Tromey <tromey@redhat.com> * Makefile.in (TEST_DIRS): Remove. (TEST_TARGETS, check-parallel): Rewrite. (check-gdb.%, BASE1_FILES, BASE2_FILES, check-gdb.base%) (subdir_do, subdirs): Remove. (do-check-parallel, check/%): New targets. (clean): Remove outputs, temp, and cache directories. (saw_dash_j): New variable. (CHECK_TARGET): Use it. (check): Depend on all, site.exp. Rewrite. (check-single): Remove dependencies. (slow_tests, all_tests, reordered_tests): New variables.
2013-11-04fix some fission testsTom Tromey5-5/+28
A couple of Fission tests rely on the current directory layout. This assumption is not valid in parallel mode. This patch fixes the problem by removing the relative directory from the .S files and instead having the tests set debug-file-directory before opening the main file. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.dwarf2/fission-base.S: Remove "gdb.dwarf/". * gdb.dwarf2/fission-base.exp: Set debug-file-directory before loading binfile. * gdb.dwarf2/fission-loclists.S: Remove "gdb.dwarf/". * gdb.dwarf2/fission-loclists.exp: Set debug-file-directory before loading binfile.
2013-11-04fix some "exec" testsTom Tromey7-15/+36
A few tests run an inferior that execs some other program. The name of this exec'd program is compiled in. These tests assume the current test suite directory layout, but fail in parallel mode. This patch fixes these tests by letting the .exp files pass in the directory names at compile time. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.base/foll-exec.c (main): Use BASEDIR. * gdb.base/foll-exec.exp: Define BASEDIR during compilation. * gdb.base/foll-vfork.c (main): Use BASEDIR. * gdb.base/foll-vfork.exp: Define BASEDIR during compilation. * gdb.multi/bkpt-multi-exec.c (main): Use BASEDIR. * gdb.multi/bkpt-multi-exec.exp: Define BASEDIR during compilation.
2013-11-04fix argv0-symlink.exp for parallel modeTom Tromey2-2/+14
argv0-symlink.exp doesn't work properly if standard_output_file puts files into a per-test subdirectory. That's because it assumes that files appear in $subdir, which is no longer true. This patch fixes the problem by computing the correct directory at runtime. Tested both with and without GDB_PARALLEL on x86-64 Fedora 18. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.base/argv0-symlink.exp: Compute executable's directory dynamically.
2013-11-04make gdb.asm parallel-safeTom Tromey2-6/+13
This fixes gdb.asm to be parallel-safe. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.asm/asm-source.exp: Use standard_output_file.
2013-11-04fix up gdb.serverTom Tromey2-7/+18
This fixes gdb.server to be parallel-safe. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.server/file-transfer.exp: Use standard_output_file.
2013-11-04introduce relative_filename and use itTom Tromey6-28/+56
This introduces a new relative_filename proc to gdb.exp and changes some tests to use it. This helps make these tests parallel-safe. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.base/fullname.exp: Use standard_output_file, relative_filename. * gdb.base/hashline1.exp: Use standard_testfile, standard_output_file, relative_filename, clean_restart. * gdb.base/hashline2.exp: Use standard_testfile, standard_output_file. * gdb.base/hashline3.exp: Use standard_testfile, standard_output_file, relative_filename. * lib/gdb.exp (relative_filename): New proc.
2013-11-04update fileio testTom Tromey3-35/+52
This updates the fileio test to be parallel-safe. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.base/fileio.c (test_open, test_write, test_read) (test_lseek, test_close, test_stat, test_fstat) (test_isatty, test_system, test_rename, test_unlink): Use OUTDIR define. * gdb.base/fileio.exp: Define OUTDIR during compilation. Use standard_output_file.
2013-11-04update checkpoint testTom Tromey3-17/+26
This fixes the "checkpoint" test to use the standard output directory. This makes the test be parallel-safe. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.base/checkpoint.c (main): Use PI_TXT and COPY1_TXT defines. * gdb.base/checkpoint.exp: Define PI_TXT and COPY1_TXT during compilation. Use prepare_for_testing, standard_output_file.
2013-11-04simple changes in gdb.baseTom Tromey15-139/+208
This makes more changes in gdb.base to make it parallel-safe. I think the changes in this particular patch are relatively straightforward, so I've grouped them all together. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.base/advance.exp: Use standard_testfile and prepare_for_testing. * gdb.base/bigcore.exp: Use standard_output_file. "cd" to appropriate directory when local. * gdb.base/dump.exp: Use standard_output_file. Update all "dump" and "restore" filenames. * gdb.base/interact.exp: Use standard_output_file. * gdb.base/jit-so.exp: Don't download file when local. * gdb.base/jit.exp (compile_jit_test): Don't download file when local. * gdb.base/list.exp: Use gdb_remote_download. * gdb.base/maint.exp: Use standard_output_file. * gdb.base/prelink.exp: Use standard_output_file. * gdb.base/save-bp.exp: Use standard_output_file. * gdb.base/sepdebug.exp: Use standard_testfile, standard_output_file. (test_different_dir): Don't declare objdir. * gdb.base/solib-search.exp: Use standard_output_file. * gdb.base/step-line.exp: Use gdb_remote_download. * gdb.base/trace-commands.exp: Use standard_output_file.
2013-11-04fix up gdb.traceTom Tromey4-25/+71
This fixes gdb.trace to be parallel-safe. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.trace/mi-traceframe-changed.exp: Pass -DTFILE_DIR to compilation. Use standard_output_file. (test_tfind_tfile): Update. * gdb.trace/tfile.c (write_basic_trace_file) (write_error_trace_file): Use TFILE_DIR. * gdb.trace/tfile.exp: Pass -DTFILE_DIR to compilation. Use standard_output_file.
2013-11-04fix up gdb.miTom Tromey4-11/+31
This fixes gdb.mi to be parallel-safe. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.mi/mi-cmd-param-changed.exp (test_command_param_changed): Use "dwarf2 always-disassemble" for the "maint set" test. * gdb.mi/mi-file-transfer.exp (test_file_transfer): Use standard_output_file. * gdb.mi/mi-logging.exp: Use standard_output_file.
2013-11-04fix up gdb.xmlTom Tromey3-20/+46
This fixes the gdb.xml tests to be parallel-safe. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.xml/tdesc-arch.exp: Use standard_output_file. Make downloads conditional on remote host. (set_arch): Likewise. * gdb.xml/tdesc-regs.exp: Use gdb_remote_download. (load_description): Use standard_output_file.
2013-11-04fix up gdb.gdbTom Tromey3-4/+22
This fixes the gdb.gdb tests to be parallel-safe, by ensuring that the new "xgdb" file ends up in the standard output directory during the tests. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.gdb/selftest.exp: Use standard_output_file. * lib/selftest-support.exp (do_self_tests): Use standard_output_file.
2013-11-04fix weird.exp for parallel testingTom Tromey2-1/+7
This fixes up gdb.stabs/weird.exp for parallel testing. This just means using gdb_remote_download and standard_output_file, so that the tests end up in the right place. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.stabs/weird.exp: Use gdb_remote_download and standard_output_file.
2013-11-04fix some simple thinkos in the test suiteTom Tromey3-3/+11
This fixes some parallelization thinkos from a while ago. I'm not sure how the problems ever slipped through. In addition to a thinko fix in twice.exp, this also finishes fixing it up for parallelization. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.base/gcore-buffer-overflow.exp: Use standard_output_file, not standard_testfile. * gdb.base/twice.exp: Use standard_testfile, not standard_output_file. Use gdb_remote_download.
2013-11-04fix up log-file togglingTom Tromey2-1/+7
Currently a proc in gdb.exp toggles the expect (and thus dejagnu) logging. This is not a super idea, but it is there to avoid putting some preprocessor output into the log. In the right circumstances, this can result in the log file being mysteriously truncated. I think this happens because it doesn't necessarily write to the correct log file again. The fix is to use "log_file -info" to save the previous log file. 2013-11-04 Tom Tromey <tromey@redhat.com> * lib/gdb.exp (get_compiler_info): Use log_file -info and restore from that.
2013-11-02gdb.cp/derivation.exp: s/perrro/perror/Maciej W. Rozycki2-1/+5
2013-11-01gdb.dwarf2/dwzbuildid.exp: Avoid reserved variable nameMaciej W. Rozycki2-3/+8
* gdb.dwarf2/dwzbuildid.exp: Rename `outdir' variable to `debugdir'.
2013-10-31Extra error message from update_watchpointAndrew Burgess3-3/+33
https://sourceware.org/ml/gdb-patches/2013-10/msg00551.html gdb/ChangeLog * breakpoint.c (update_watchpoint): Update error message and add an additional error message. gdb/testsuite/ChangeLog * gdb.base/watchpoint.exp (test_no_hw_watchpoints): Add additional tests and update expected error message. (test_watch_register_location): New tests. (do_tests): Call test_watch_register_location. * gdb.base/watchpoints.exp: Update expected error message.
2013-10-30S/390: Add missing gdb_prompt in s390-multiarch.expUlrich Weigand2-2/+9
Correct the patterns in the gdb_test_multiple invocation. testsuite/ 2013-10-30 Andreas Arnez <arnez@linux.vnet.ibm.com> * gdb.arch/s390-multiarch.exp (test_linux_v2): Add $gdb_prompt to the patterns in gdb_test_multiple.
2013-10-29ChangeLog entries for the remove-symbol-file commits.Nicolas Blanc1-0/+9
2013-10-29gdb.mi/mi-console.c, gdb.mi/mi-stack.c: Remove local emacs variables ↵Pedro Alves3-13/+5
defining change-log-default-name. These references to ChangeLog-mi are stale. testsuite/gdb.mi/ChangeLog-mi doesn't exist anymore, since: ... commit 2dd627049d915a78ba15b65ab718d54958d115bf Author: Andrew Cagney <cagney@redhat.com> Date: Sat Jun 23 21:47:09 2001 +0000 Rename gdb.mi/ChangeLog-mi to gdb.mi/ChangeLog. Update everything. ... commit 48efe7049b1c286c702621e2f3e89e4584df2bd2 Author: Andrew Cagney <cagney@redhat.com> Date: Mon Jan 12 15:16:44 2004 +0000 Eliminate the old mi/tui specific ChangeLog files as in ... Added Files: mi/ChangeLog-1999-2003 testsuite/gdb.mi/ChangeLog-1999-2003 tui/ChangeLog-1998-2003 Removed Files: mi/ChangeLog testsuite/gdb.mi/ChangeLog tui/ChangeLog Tested with 'make check RUNTESTFLAGS="--directory=gdb.mi"' on x86_64 Fedora 17. gdb/testsuite/ 2013-10-29 Pedro Alves <palves@redhat.com> * gdb.mi/mi-console.c, gdb.mi/mi-stack.c: Remove local emacs variable setting change-log-default-name to ChangeLog-mi.
2013-10-29Print <unavailable> for unavailable registers in info register output.Andrew Burgess2-2/+7
https://sourceware.org/ml/gdb-patches/2013-08/msg00171.html gdb/ChangeLog * infcmd.c (default_print_one_register_info): Use val_print to print all values even optimized out or unavailable ones. Don't try to print a raw form of optimized out or unavailable values. gdb/testsuite/ChangeLog * gdb.trace/unavailable.exp (gdb_unavailable_registers_test): Expect <unavailable> pattern.
2013-10-29Test adding and removing a symbol file at runtime.Nicolas Blanc5-0/+715
This test exercises the commands 'add-symbol-file' and 'remove-symbol-file'. 2013-10-29 Nicolas Blanc <nicolas.blanc@intel.com> gdb/testsuite * gdb.base/sym-file-lib.c: New file. * gdb.base/sym-file-loader.c: New file. * gdb.base/sym-file-loader.h: New file. * gdb.base/sym-file-main.c: New file. * gdb.base/sym-file.exp: New file. Signed-off-by: Nicolas Blanc <nicolas.blanc@intel.com>
2013-10-29Function is_elf_target.Nicolas Blanc1-0/+39
2013-10-29 Nicolas Blanc <nicolas.blanc@intel.com> gdb/testsuite * lib/gdb.exp (is_elf_target): New function. Signed-off-by: Nicolas Blanc <nicolas.blanc@intel.com>
2013-10-28Fix typo in gdb/testsuite/gdb.arch/thumb2-it.S.Tom de Vries2-1/+5
2013-10-28 Tom de Vries <tom@codesourcery.com> * gdb.arch/thumb2-it.S (it_8): Fix typo.
2013-10-25testsuite: Fix gdb.base/bang.exp for remote stubs without exitAnton Kolesov2-9/+7
Some remote stubs do not have a proper exit() function implementation. gdb.base/bang.exp was failing on those targets due to timeout. With this patch bang.exp uses already defined library procedures to handle this situation gracefully without breaking native targets. Tested with x86_64 (unix, native-gdbserver) and with arc-*-elf32. gdb/testsuite/ChangeLog: 2013-10-25 Anton Kolesov <Anton.Kolesov@synopsys.com> (tiny change) * gdb.base/bang.exp: Use gdb_continue_to_end to properly support remote stubs where exit() behaviour is unreliable.
2013-10-25Print nonexisting/optimized out static fields gracefully.Pedro Alves2-1/+10
With: struct static_struct { static int aaa; }; struct static_struct sss; int main () { return 0; } We get: (gdb) p sss $1 = {static aaa = <optimized out>} (gdb) p sss.aaa field aaa is nonexistent or has been optimized out Note that the "field aaa ..." message is an error being thrown. GDB is graceful everywhere else when printing optimized out values. IOW it usually prints an <optimized out> value and puts that in the value history. I see no reason for here to be different, more so that when the print the whole "containing" object (well, it's a static field, so it's not really a container), we already print <optimized out>. After the patch: (gdb) p sss $1 = {static aaa = <optimized out>} (gdb) p sss.aaa $2 = <optimized out> The value_entirely_optimized_out checks are there to preserve behavior. Without those, if the static field is a struct/union, GDB would go and print its fields one by one (and print <optimized out> for each). Tested on x86_64 Fedora 17. gdb/ 2013-10-25 Pedro Alves <palves@redhat.com> * cp-valprint.c (cp_print_value_fields): No longer handle a NULL static field value. (cp_print_static_field): If the value is entirely optimized out, print <optimized out> here. * jv-valprint.c (java_print_value_fields): No longer handle a NULL static field value. * p-valprint.c (pascal_object_print_static_field): If the value is entirely optimized out, print <optimized out> here. * valops.c (do_search_struct_field) (value_struct_elt_for_reference): No longer handle a NULL static field value. * value.c (value_static_field): Return an optimized out value instead of NULL. gdb/testsuite/ 2013-10-25 Pedro Alves <palves@redhat.com> * gdb.cp/m-static.exp: Adjust expected output of printing a nonexistent or optimized out static field. Also test printing the the "container" object.
2013-10-25testsuite: Persistent gdbserver cleanupMaciej W. Rozycki3-0/+24
* lib/gdb.exp (gdb_finish): Send a kill request to `gdbserver' if in the persistent mode. * gdb.trace/disconnected-tracing.exp: Reconnect before completion.
2013-10-25Avoid producing broken non-native core filesMaciej W. Rozycki2-1/+6
gdb/ * linux-tdep.c (linux_corefile_thread_callback): Propagate any failure from register information collection. gdb/testsuite/ * lib/gdb.exp (gdb_gcore_cmd): Also handle a "Target does not support core file generation" reply.
2013-10-212013-10-21 Jose E. Marchesi <jose.marchesi@oracle.com>Jose E. Marchesi3-3/+16
PR gdb/15986 * gdb.base/run.c (main): gdb_get_line_number tag added for commands.exp. (factorial): Likewise. * gdb.base/commands.exp (watchpoint_command_test): Use gdb_get_line_number in order to determine the locations in run.c where local_var is detected to go out of scope.
2013-10-212013-10-21 Jose E. Marchesi <jose.marchesi@oracle.com>Jose E. Marchesi2-1/+19
* gdb.base/gnu_vector.exp: Care about endianness when casting scalars to vectors.
2013-10-18 * lib/gdb.exp (build_executable_from_specs): Remove duplicate setTom Tromey2-2/+5
of "binfile".
2013-10-18Hardware watchpoints turned off, inferior not yet started.Andrew Burgess2-0/+28
https://sourceware.org/ml/gdb-patches/2013-10/msg00477.html gdb/ChangeLog * breakpoint.c (update_watchpoint): If hardware watchpoints are forced off, downgrade them to software watchpoints if possible, and error out if not possible. (watch_command_1): Move watchpoint type selection closer to watchpoint creation, and extend the comments. gdb/testsuite/ChangeLog * gdb.base/watchpoints.exp: Add test for setting software watchpoints of different types before starting the inferior.
2013-10-18[gdb/16062] stepi sometimes doesn't make progressPedro Alves3-0/+158
I noticed something odd while doing "stepi" over a fork syscall: ... (gdb) set disassemble-next-line on ... (gdb) si 0x000000323d4ba7c2 131 pid = ARCH_FORK (); 0x000000323d4ba7a4 <__libc_fork+132>: 64 4c 8b 04 25 10 00 00 00 mov %fs:0x10,%r8 0x000000323d4ba7ad <__libc_fork+141>: 31 d2 xor %edx,%edx 0x000000323d4ba7af <__libc_fork+143>: 4d 8d 90 d0 02 00 00 lea 0x2d0(%r8),%r10 0x000000323d4ba7b6 <__libc_fork+150>: 31 f6 xor %esi,%esi 0x000000323d4ba7b8 <__libc_fork+152>: bf 11 00 20 01 mov $0x1200011,%edi 0x000000323d4ba7bd <__libc_fork+157>: b8 38 00 00 00 mov $0x38,%eax => 0x000000323d4ba7c2 <__libc_fork+162>: 0f 05 syscall 0x000000323d4ba7c4 <__libc_fork+164>: 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax 0x000000323d4ba7ca <__libc_fork+170>: 0f 87 2b 01 00 00 ja 0x323d4ba8fb <__libc_fork+475> (gdb) si 0x000000323d4ba7c4 131 pid = ARCH_FORK (); 0x000000323d4ba7a4 <__libc_fork+132>: 64 4c 8b 04 25 10 00 00 00 mov %fs:0x10,%r8 0x000000323d4ba7ad <__libc_fork+141>: 31 d2 xor %edx,%edx 0x000000323d4ba7af <__libc_fork+143>: 4d 8d 90 d0 02 00 00 lea 0x2d0(%r8),%r10 0x000000323d4ba7b6 <__libc_fork+150>: 31 f6 xor %esi,%esi 0x000000323d4ba7b8 <__libc_fork+152>: bf 11 00 20 01 mov $0x1200011,%edi 0x000000323d4ba7bd <__libc_fork+157>: b8 38 00 00 00 mov $0x38,%eax 0x000000323d4ba7c2 <__libc_fork+162>: 0f 05 syscall => 0x000000323d4ba7c4 <__libc_fork+164>: 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax 0x000000323d4ba7ca <__libc_fork+170>: 0f 87 2b 01 00 00 ja 0x323d4ba8fb <__libc_fork+475> (gdb) si 0x000000323d4ba7c4 131 pid = ARCH_FORK (); 0x000000323d4ba7a4 <__libc_fork+132>: 64 4c 8b 04 25 10 00 00 00 mov %fs:0x10,%r8 0x000000323d4ba7ad <__libc_fork+141>: 31 d2 xor %edx,%edx 0x000000323d4ba7af <__libc_fork+143>: 4d 8d 90 d0 02 00 00 lea 0x2d0(%r8),%r10 0x000000323d4ba7b6 <__libc_fork+150>: 31 f6 xor %esi,%esi 0x000000323d4ba7b8 <__libc_fork+152>: bf 11 00 20 01 mov $0x1200011,%edi 0x000000323d4ba7bd <__libc_fork+157>: b8 38 00 00 00 mov $0x38,%eax 0x000000323d4ba7c2 <__libc_fork+162>: 0f 05 syscall => 0x000000323d4ba7c4 <__libc_fork+164>: 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax 0x000000323d4ba7ca <__libc_fork+170>: 0f 87 2b 01 00 00 ja 0x323d4ba8fb <__libc_fork+475> (gdb) si 0x000000323d4ba7ca 131 pid = ARCH_FORK (); 0x000000323d4ba7a4 <__libc_fork+132>: 64 4c 8b 04 25 10 00 00 00 mov %fs:0x10,%r8 0x000000323d4ba7ad <__libc_fork+141>: 31 d2 xor %edx,%edx 0x000000323d4ba7af <__libc_fork+143>: 4d 8d 90 d0 02 00 00 lea 0x2d0(%r8),%r10 0x000000323d4ba7b6 <__libc_fork+150>: 31 f6 xor %esi,%esi 0x000000323d4ba7b8 <__libc_fork+152>: bf 11 00 20 01 mov $0x1200011,%edi 0x000000323d4ba7bd <__libc_fork+157>: b8 38 00 00 00 mov $0x38,%eax 0x000000323d4ba7c2 <__libc_fork+162>: 0f 05 syscall 0x000000323d4ba7c4 <__libc_fork+164>: 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax => 0x000000323d4ba7ca <__libc_fork+170>: 0f 87 2b 01 00 00 ja 0x323d4ba8fb <__libc_fork+475> Notice how the third "si" didn't actually make progress. Turning on infrun and lin-lwp debug, we see: (gdb) infrun: clear_proceed_status_thread (process 5252) infrun: proceed (addr=0xffffffffffffffff, signal=144, step=1) infrun: resume (step=1, signal=0), trap_expected=0, current thread [process 5252] at 0x323d4ba7c4 LLR: Preparing to step process 5252, 0, inferior_ptid process 5252 RC: Not resuming sibling process 5252 (not stopped) LLR: PTRACE_SINGLESTEP process 5252, 0 (resume event thread) sigchld infrun: wait_for_inferior () linux_nat_wait: [process -1], [] LLW: enter LNW: waitpid(-1, ...) returned 5252, No child processes LLW: waitpid 5252 received Child exited (stopped) LLW: Candidate event Child exited (stopped) in process 5252. SEL: Select single-step process 5252 LLW: exit infrun: target_wait (-1, status) = infrun: 5252 [process 5252], infrun: status->kind = stopped, signal = SIGCHLD infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x323d4ba7c4 infrun: random signal 20 infrun: stepi/nexti infrun: stop_stepping So the inferior got a SIGCHLD (because the fork child exited while we're doing 'si'), and since that signal is set to "nostop noprint pass" (by default), it's considered a random signal, so it should not cause a stop. But, it resulted in an immediate a stop_stepping call anyway. So the single-step never really finished. This is a regression caused by: [[PATCH] Do not respawn signals, take 2.] https://sourceware.org/ml/gdb-patches/2012-06/msg00702.html Specifically, caused by this change (as mentioned in the "the lost step issue first" part of that mail): diff --git a/gdb/infrun.c b/gdb/infrun.c index 53db335..3e8dbc8 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4363,10 +4363,8 @@ process_event_stop_test: (leaving the inferior at the step-resume-breakpoint without actually executing it). Either way continue until the breakpoint is really hit. */ - keep_going (ecs); - return; } - + else /* Handle cases caused by hitting a breakpoint. */ { That made GDB fall through to the > /* In all-stop mode, if we're currently stepping but have stopped in > some other thread, we need to switch back to the stepped thread. */ > if (!non_stop) part. However, if we don't have a stepped thread to get back to, we'll now also fall through to all the "stepping" tests. For line stepping, that'll turn out okay, as we'll just end up realizing the thread is still in the stepping range, and needs to be re-stepped. However, for stepi/nexti, we'll reach: if (ecs->event_thread->control.step_range_end == 1) { /* It is stepi or nexti. We always want to stop stepping after one instruction. */ if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: stepi/nexti\n"); ecs->event_thread->control.stop_step = 1; print_end_stepping_range_reason (); stop_stepping (ecs); return; } and stop, even though the thread actually made no progress. The fix is to restore the keep_going call, but put it after the "switch back to the stepped thread" code, and before the stepping tests. Tested on x86_64 Fedora 17, native and gdbserver. New test included. gdb/ 2013-10-18 Pedro Alves <palves@redhat.com> PR gdb/16062 * infrun.c (handle_inferior_event): Keep going if we got a random signal we should not stop for, instead of falling through to the step tests. gdb/testsuite/ 2013-10-18 Pedro Alves <palves@redhat.com> PR gdb/16062 * gdb.threads/stepi-random-signal.c: New file. * gdb.threads/stepi-random-signal.exp: New file.
2013-10-17 * gdb.mi/mi-breakpoint-changed.exp (test_insert_delete_modify):Maciej W. Rozycki3-2/+8
Fix comment typo. * lib/gdb.exp (gdb_init): Likewise.
2013-10-17fix for PR gdb/15995Tom Tromey2-0/+10
This patch fixes PR gdb/15995. The bug here is that gdb's printf command does not flush the output stream. This makes a printf that is not newline-terminated interleave incorrectly with other forms of output, such as that generated via a call to an external program using "shell". I note that the "output" command already does this flushing. The fix is to call gdb_flush in printf_command. Built and regtested on x86-64 Fedora 18. New test case included. PR gdb/15995: * printcmd.c (printcmd): Call gdb_flush. * gdb.base/printcmds.exp (test_printf): Test printf flushing.
2013-10-14 * gdb.dwarf2/dwzbuildid.exp (write_dwarf_file): Pass explicit testTom Tromey2-1/+7
name to gdb_test_no_output.
2013-10-13Improve Executable displayed path (PR 15415 regression kind #2)Jan Kratochvil2-0/+14
gdb/ 2013-10-13 Jan Kratochvil <jan.kratochvil@redhat.com> Canonicalize directories for EXEC_FILENAME. * exec.c (exec_file_attach): Use gdb_realpath_keepfile for exec_filename. * utils.c (gdb_realpath_keepfile): New function. * utils.h (gdb_realpath_keepfile): New declaration. gdb/testsuite/ 2013-10-13 Jan Kratochvil <jan.kratochvil@redhat.com> Canonicalize directories for EXEC_FILENAME. * gdb.base/argv0-symlink.exp (kept file symbolic link name for info inferiors): New. (kept directory symbolic link name): Setup kfail. (kept directory symbolic link name for info inferiors): New.
2013-10-11testsuite/ChangeLog:Ulrich Weigand3-0/+478
2013-10-11 Andreas Arnez <arnez@linux.vnet.ibm.com> * gdb.arch/s390-multiarch.exp: New file. * gdb.arch/s390-multiarch.c: New file.