aboutsummaryrefslogtreecommitdiff
path: root/gdb
AgeCommit message (Collapse)AuthorFilesLines
2013-11-06gdb/dwarf2read.c: Sanity check DW_AT_sibling values.Will Newton2-2/+26
When reading objects with corrupt debug information it is possible that the sibling chain can form a loop, which leads to an infinite loop and memory exhaustion. Avoid this situation by disregarding and DW_AT_sibling values that point to a lower address than the current entry. gdb/ChangeLog: 2013-11-06 Will Newton <will.newton@linaro.org> PR gdb/12866 * dwarf2read.c (skip_one_die): Sanity check DW_AT_sibling values. (read_partial_die): Likewise.
2013-11-06Revert "2013-11-06 Muhammad Bilal <mbilal@codesourcery.com>"Muhammad Bilal2-6/+1
This reverts commit dd99d3d15a7d8f41e139dea7871c4fe44cd4b616.
2013-11-062013-11-06 Muhammad Bilal <mbilal@codesourcery.com>Muhammad Bilal2-1/+6
PR cli/15224 * top.c (init_main): 'set history save on' by default.
2013-11-06[DOC] shell startup files, clarifications and fixes.Pedro Alves2-11/+21
When Bash is started non-interactively, it runs the script pointed by the BASH_ENV environment variable, not .bashrc. While at it, mention Z shell in the warning too, and mention non-interactive mode explicitly. gdb/doc/ 2013-11-06 Pedro Alves <palves@redhat.com> * gdb.texinfo (Starting) <set/show startup-with-shell>: Mention non-interactive mode. (Environment) <shell startup files warning>: Mention non-interactive mode. Mention .zshenv for Z shell, and talk about BASH_ENV instead of .bashrc for BASH.
2013-11-062013-11-06 Muhammad Bilal <mbilal@codesourcery.com>Muhammad Bilal3-4/+9
PR cli/16122 * top.c (command_line_input): Unify interactivity tests to use input_from_terminal_p. * event-top.c (command_line_handler): Likewise.
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 Qi7-2/+41
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-05gdb/arm-tdep.c: Use filtered output in arm_print_float_info.Will Newton2-13/+19
gdb/ChangeLog: 2013-11-05 Will Newton <will.newton@linaro.org> PR gdb/7670 * arm-tdep.c (print_fpu_flags): Use filtered output routines. (arm_print_float_info): Likewise.
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-04Improve performance of large restore commandsAnton Blanchard2-0/+11
I noticed a large (100MB) restore took hours to complete. The problem is memory_xfer_partial repeatedly mallocs and memcpys the entire 100MB buffer for breakpoint shadow handling only to find a small portion of it is actually written. The testcase that originally took hours now takes 50 seconds. gdb/ 2013-07-29 Anton Blanchard <anton@samba.org> * target.c (memory_xfer_partial): Cap write to 4KB.
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-11-01breakpoint.c: fix libc probe scan when no get_longjmp_target exists.Tiago Stürmer Daitx2-2/+8
As discussed on the GDB ML[1], libc probes for longjmp were not being loaded if a custom <arch>_get_longjmp_target function was not implemented. This is trivially fixed by moving the 'if (!gdbarch_get_longjmp_target_p (gdbarch))' down, just bellow libc probe code and above the per-objfile cache lookup. While the condition could also be removed altogether with no side-effects, it is in fact an optimization to avoid searching for symbols if the arch doesn't provide support for get_longjmp_target(). This has been tested on PPC and PPC64. [1] https://sourceware.org/ml/gdb/2013-10/msg00191.html gdb/ 2013-11-01 Tiago Stürmer Daitx <tdaitx@linux.vnet.ibm.com> * breakpoint.c (create_longjmp_master_breakpoint): Allow libc probe scan even when the arch provides no get_longjmp_target.
2013-10-31infrun.c: use GDB_SIGNAL_0 when hidding signals, not GDB_SIGNAL_TRAP.Pedro Alves2-9/+15
IMO, it doesn't make sense to map random syscall, fork, etc. events to GDB_SIGNAL_TRAP, and possible have the debuggee see that trap. This just seems conceptually wrong to me - these aren't real signals a debuggee would ever see. In fact, when stopped for those events, on Linux, the debuggee isn't in a signal-stop -- there's no way to resume-and-deliver-signal at that point, for example. E.g., when stopped at a fork event: (gdb) catch fork Catchpoint 2 (fork) (gdb) c Continuing. Catchpoint 2 (forked process 4570), 0x000000323d4ba7c4 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/fork.c:131 131 pid = ARCH_FORK (); (gdb) set debug infrun 1 (gdb) signal SIGTRAP Continuing with signal SIGTRAP. infrun: clear_proceed_status_thread (process 4566) infrun: proceed (addr=0xffffffffffffffff, signal=5, step=0) infrun: resume (step=0, signal=5), trap_expected=0, current thread [process 4566] at 0x323d4ba7c4 infrun: wait_for_inferior () infrun: target_wait (-1, status) = infrun: 4566 [process 4566], infrun: status->kind = exited, status = 0 infrun: infwait_normal_state infrun: TARGET_WAITKIND_EXITED [Inferior 1 (process 4566) exited normally] infrun: stop_stepping (gdb) Note the signal went nowhere. It was swallowed. Resuming with a SIGTRAP from a syscall event does queue the signal, but doesn't deliver it immediately, like "signal SIGTRAP" from a real signal would. It's still an artificial SIGTRAP: (gdb) catch syscall Catchpoint 2 (any syscall) (gdb) c Continuing. Catchpoint 2 (call to syscall clone), 0x000000323d4ba7c4 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/fork.c:131 131 pid = ARCH_FORK (); (gdb) set debug infrun 1 (gdb) signal SIGTRAP Continuing with signal SIGTRAP. infrun: clear_proceed_status_thread (process 4622) infrun: proceed (addr=0xffffffffffffffff, signal=5, step=0) infrun: resume (step=0, signal=5), trap_expected=0, current thread [process 4622] at 0x323d4ba7c4 infrun: wait_for_inferior () infrun: target_wait (-1, status) = infrun: 4622 [process 4622], infrun: status->kind = exited syscall infrun: infwait_normal_state infrun: TARGET_WAITKIND_SYSCALL_RETURN infrun: syscall number = '56' infrun: BPSTAT_WHAT_STOP_NOISY infrun: stop_stepping Catchpoint 2 (returned from syscall clone), 0x000000323d4ba7c4 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/fork.c:131 131 pid = ARCH_FORK (); (gdb) c Continuing. infrun: clear_proceed_status_thread (process 4622) infrun: proceed (addr=0xffffffffffffffff, signal=144, step=0) infrun: resume (step=0, signal=0), trap_expected=0, current thread [process 4622] at 0x323d4ba7c4 infrun: wait_for_inferior () infrun: target_wait (-1, status) = infrun: 4622 [process 4622], infrun: status->kind = stopped, signal = SIGTRAP infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x323d4ba7c4 infrun: random signal 5 Program received signal SIGTRAP, Trace/breakpoint trap. infrun: stop_stepping 0x000000323d4ba7c4 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/fork.c:131 131 pid = ARCH_FORK (); (gdb) In all the above, I used 'signal SIGTRAP' to emulate 'handle SIGTRAP pass'. As described in "keep_going", 'handle SIGTRAP pass' does have its place: /* Do not deliver GDB_SIGNAL_TRAP (except when the user explicitly specifies that such a signal should be delivered to the target program). Typically, that would occur when a user is debugging a target monitor on a simulator: the target monitor sets a breakpoint; the simulator encounters this breakpoint and halts the simulation handing control to GDB; GDB, noting that the stop address doesn't map to any known breakpoint, returns control back to the simulator; the simulator then delivers the hardware equivalent of a GDB_SIGNAL_TRAP to the program being debugged. */ ... and I've made use of that myself when implementing/debugging stubs/monitors. But in these cases, treating these events as SIGTRAP possibly injects signals in the debuggee they'd never see otherwise, because you need to use ptrace to enable these special events, which aren't real signals. There's more. Take this bit of handle_inferior_event, where we determine whether a real signal (TARGET_WAITKIND_STOPPED) was random or not: if (ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP) ecs->random_signal = !((bpstat_explains_signal (ecs->event_thread->control.stop_bpstat, GDB_SIGNAL_TRAP) != BPSTAT_SIGNAL_NO) || stopped_by_watchpoint || ecs->event_thread->control.trap_expected || (ecs->event_thread->control.step_range_end && (ecs->event_thread->control.step_resume_breakpoint == NULL))); else { enum bpstat_signal_value sval; sval = bpstat_explains_signal (ecs->event_thread->control.stop_bpstat, ecs->event_thread->suspend.stop_signal); ecs->random_signal = (sval == BPSTAT_SIGNAL_NO); if (sval == BPSTAT_SIGNAL_HIDE) ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_TRAP; } Note that the if (sval == BPSTAT_SIGNAL_HIDE) ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_TRAP; bit is only reacheable for signals != GDB_SIGNAL_TRAP. AFAICS, sval can only be BPSTAT_SIGNAL_HIDE if nothing in the bpstat returns BPSTAT_SIGNAL_PASS. So that excludes a "catch signal" for the signal in question in the bpstat. All other catchpoints that aren't based on breakpoints behind the scenes call process_event_stop_test directly (don't pass through here) (well, almost all: TARGET_WAITKIND_LOADED does have a fall through, but only for STOP_QUIETLY or STOP_QUIETLY_NO_SIGSTOP, which still return before this code is reached). Catchpoints that are implemented as breakpoints behind the scenes can only appear in the bpstat if the signal was GDB_SIGNAL_TRAP (bkpt_breakpoint_hit returns false otherwise). So that leaves a target reporting a hardware watchpoint hit with a signal other than GDB_SIGNAL_TRAP. And even then it looks quite wrong to me to magically convert the signal into a GDB_SIGNAL_TRAP here too -- if the user has set SIGTRAP to "handle pass", the program will see a trap that gdb invented, not one the program would ever see without gdb in the picture. Tested on x86_64 Fedora 17. gdb/ 2013-10-31 Pedro Alves <palves@redhat.com> * infrun.c (handle_syscall_event): Don't set or clear stop_signal. (handle_inferior_event) <TARGET_WAITKIND_FORKED, TARGET_WAITKIND_VFORKED>: Don't set stop_signal to GDB_SIGNAL_TRAP, or clear it. Pass GDB_SIGNAL_0 to bpstat_explains signal, instead of GDB_SIGNAL_TRAP. <bpstat handling>: If the bpstat chain wants the signal to be hidden, then set stop_signal to GDB_SIGNAL_0 instead of GDB_SIGNAL_TRAP.
2013-10-31Extra error message from update_watchpointAndrew Burgess5-6/+48
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-30S/390: Rename source files to *-linux-*Ulrich Weigand8-9/+27
As suggested before, rename the S/390-related source files (tdep and nat) such that "-linux-" occurs in the file name, like with other GNU/Linux targets. Since no other operating system is currently supported by GDB on this architecture, this isn't strictly necessary. But the old names sometimes caused GDB contributors to miss these files when performing a change that affects all GNU/Linux targets. The latest such incident was observed here: https://sourceware.org/ml/gdb-patches/2013-09/msg00619.html gdb/ 2013-10-30 Andreas Arnez <arnez@linux.vnet.ibm.com> * s390-tdep.h: Rename to... * s390-linux-tdep.h: ...here. * s390-tdep.c: Rename to... * s390-linux-tdep.c: ...here. Adjust #include. * s390-nat.c: Rename to... * s390-linux-nat.c: ...here. Adjust #include. * config/s390/s390.mh: Rename to... * config/s390/linux.mh: ...here. Reflect rename s390-nat.o -> s390-linux-nat.o. * configure.host: Reflect host rename "s390" -> "linux". * configure.tgt: Reflect rename s390-tdep.o -> s390-linux-tdep.o. * Makefile.in (ALL_TARGET_OBS): Likewise. (HFILES_NO_SRCDIR): Reflect rename s390-tdep.h -> s390-linux-tdep.h. (ALLDEPFILES): Reflect rename of .c files.
2013-10-30Clean up whitespace in S/390 -tdep and -nat files.Ulrich Weigand4-134/+139
gdb/ 2013-10-30 Andreas Arnez <arnez@linux.vnet.ibm.com> * s390-nat.c: Whitespace cleanup. * s390-tdep.c: Likewise. * s390-tdep.h: Remove empty line at end of file.
2013-10-30linux-tdep.c: Fix "warning: 'siginfo_size' may be used uninitialized..."Maciej W. Rozycki2-1/+6
* linux-tdep.c (linux_corefile_thread_callback): Preinitialize siginfo_size.
2013-10-29undef reg in gdb_curses.hTom Tromey3-5/+13
I tried to build gdb on the AIX machine in the GCC compile farm (gcc111), but it failed in a couple of spots because gdb uses "reg" as a variable name and the AIX <curses.h> defines "reg" to "register". I saw that we already had a workaround for this lurking in utils.c, so I just moved that to gdb_curses.h. This fixed the problem on AIX and still builds on x86-64 Fedora 18. 2013-10-29 Tom Tromey <tromey@redhat.com> * utils.c (reg): Move undefinition... * gdb_curses.h: ... here. Update comment to mention AIX.
2013-10-29ChangeLog entries for the remove-symbol-file commits.Nicolas Blanc3-0/+35
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 Burgess4-17/+23
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-29Create target sections for user-added symbol files.Nicolas Blanc3-2/+69
Add the sections of the symbol files that are provided via 'add-symbol-file' to the set of current target sections. User-added sections are removed upon notification of free_objfile when their corresponding object file is deleted. 2013-10-29 Nicolas Blanc <nicolas.blanc@intel.com> * exec.h (add_target_sections_of_objfile): New declaration. * exec.c (add_target_sections_of_objfile): New function. * symfile.c (add_symbol_file_command): Update current target sections. (symfile_free_objfile): New function. (_initialize_symfile): Register observer for free_objfile events. Signed-off-by: Nicolas Blanc <nicolas.blanc@intel.com>
2013-10-29Documentation for the remove-symbol-file command.Nicolas Blanc2-2/+30
2013-10-29 Nicolas Blanc <nicolas.blanc@intel.com> * NEWS: Add description of the remove-symbol-file command. gdb/doc * gdb.texinfo (Commands to Specify Files): Add description of the remove-symbol-file command. Signed-off-by: Nicolas Blanc <nicolas.blanc@intel.com>
2013-10-29New remove-symbol-file command.Nicolas Blanc7-9/+209
New command for removing symbol files added via the add-symbol-file command. 2013-10-29 Nicolas Blanc <nicolas.blanc@intel.com> * breakpoint.c (disable_breakpoints_in_freed_objfile): New function. * objfiles.c (free_objfile): Notify free_objfile. (is_addr_in_objfile): New function. * objfiles.h (is_addr_in_objfile): New declaration. * printcmd.c (clear_dangling_display_expressions): Act upon free_objfile events instead of solib_unloaded events. (_initialize_printcmd): Register observer for free_objfile instead of solib_unloaded notifications. * solib.c (remove_user_added_objfile): New function. * symfile.c (remove_symbol_file_command): New command. (_initialize_symfile): Add remove-symbol-file. gdb/doc * observer.texi: New free_objfile event. Signed-off-by: Nicolas Blanc <nicolas.blanc@intel.com>
2013-10-29Simplify REGISTRY cleanup usagesYao Qi8-39/+30
In registry.c:registry_clear_data, the registered data is iterated and invoke each 'free' function with the data passed: for (registration = data_registry->registrations, i = 0; i < fields->num_data; registration = registration->next, i++) if (fields->data[i] != NULL && registration->data->free != NULL) adaptor (registration->data->free, container, fields->data[i]); we can see that data is passed to function 'free' and data is not NULL. In each usage, we don't have to get the data again through key and do NULL pointer checking. This patch is to simplify them. gdb: 2013-10-29 Yao Qi <yao@codesourcery.com> * auto-load.c (auto_load_pspace_data_cleanup): Get data from parameter 'arg' instead of from program_space_data. * objfiles.c (objfiles_pspace_data_cleanup): Likewise. * solib-darwin.c (darwin_pspace_data_cleanup): Likewise. * solib-dsbt.c (dsbt_pspace_data_cleanup): Likewise. * solib-svr4.c (svr4_pspace_data_cleanup): Likewise. * inflow.c (inflow_inferior_data_cleanup): Get data from parameter 'arg' instead of inferior_data. * registry.h: Add comments.
2013-10-28breakpoint.c:watchpoints_triggered: simplify a tiny bit.Pedro Alves2-1/+6
I was reading this, checking the the possible returns, and this particular path confused a tiny little. Above we do: if (!stopped_by_watchpoint) { ... return 0; } so any return after that always return true. Tested on x86_64 Fedora 17. gdb/ 2013-10-28 Pedro Alves <palves@redhat.com> * breakpoint.c (watchpoints_triggered) <!target_stopped_data_address>: Hardcode return 1.
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-28infrun.c:process_event_stop_test: Reindent.Pedro Alves2-187/+186
gdb/ 2013-10-28 Pedro Alves <palves@redhat.com> * infrun.c (process_event_stop_test): Remove unnecessary scoping level and reindent.