binutils-gdb/gdb/testsuite/gdb.base/annota3.exp

397 lines
10 KiB
Plaintext
Raw Normal View History

# Copyright 2003-2017 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This file was written by Elena Zannoni (ezannoni@cygnus.com)
# This testcase cannot use runto_main because of the different prompt
# we get when using annotation level 2.
#
if ![target_can_use_run_cmd] {
return 0
}
#
# test running programs
#
standard_testfile .c
2006-03-07 Paul Brook <paul@codesourcery.com> * gdb.arch/altivec-abi.exp: Use nowarnings instead of additional_flags=-w. * gdb.arch/altivec-regs.exp: Ditto. * gdb.arch/e500-abi.exp: Ditto. * gdb.arch/e500-regs.exp: Ditto. * gdb.base/all-bin.exp: Ditto. * gdb.base/annota1.exp: Ditto. * gdb.base/annota3.exp: Ditto. * gdb.base/args.exp: Ditto. * gdb.base/arithmet.exp: Ditto. * gdb.base/assign.exp: Ditto. * gdb.base/async.exp: Ditto. * gdb.base/bang.exp: Ditto. * gdb.base/break.exp: Ditto. * gdb.base/call-rt-st.exp: Ditto. * gdb.base/completion.exp: Ditto. * gdb.base/cond-expr.exp: Ditto. * gdb.base/condbreak.exp: Ditto. * gdb.base/consecutive.exp: Ditto. * gdb.base/define.exp: Ditto. * gdb.base/display.exp: Ditto. * gdb.base/ena-dis-br.exp: Ditto. * gdb.base/environ.exp: Ditto. * gdb.base/eval-skip.exp: Ditto. * gdb.base/info-proc.exp: Ditto. * gdb.base/jump.exp: Ditto. * gdb.base/logical.exp: Ditto. * gdb.base/long_long.exp: Ditto. * gdb.base/maint.exp: Ditto. * gdb.base/miscexprs.exp: Ditto. * gdb.base/pc-fp.exp: Ditto. * gdb.base/pointers.exp: Ditto. * gdb.base/relational.exp: Ditto. * gdb.base/reread.exp: Ditto. * gdb.base/sect-cmd.exp: Ditto. * gdb.base/sep.exp: Ditto. * gdb.base/sepdebug.exp: Ditto. * gdb.base/until.exp: Ditto. * gdb.base/whatis-exp.exp: Ditto. * gdb.cp/annota2.exp: Ditto. * gdb.cp/annota3.exp: Ditto. * gdb.trace/actions.exp: Ditto. * gdb.trace/backtrace.exp: Ditto. * gdb.trace/circ.exp: Ditto. * gdb.trace/collection.exp: Ditto. * gdb.trace/deltrace.exp: Ditto. * gdb.trace/infotrace.exp: Ditto. * gdb.trace/limits.exp: Ditto. * gdb.trace/packetlen.exp: Ditto. * gdb.trace/passc-dyn.exp: Ditto. * gdb.trace/passcount.exp: Ditto. * gdb.trace/report.exp: Ditto. * gdb.trace/save-trace.exp: Ditto. * gdb.trace/tfind.exp: Ditto. * gdb.trace/tracecmd.exp: Ditto. * gdb.trace/while-dyn.exp: Ditto. * gdb.trace/while-stepping.exp: Ditto. * lib/gdb.exp: Ditto. (gdb_compile): Handle nowarning option.
2006-03-07 16:23:33 +01:00
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
Fixup testcases outputting own name as a test name and standardize failed compilation messages Changes in v3: - Adjusted some testcases where the message "failed to compile" was not unique. Changes in v2: - Addressed comments from reviewers. - Fixed spurious whitespaces. - Changed compilation failure messages that included source/binary paths to ones that are short and deterministic. --- Another bit of cleanup to the testsuite. We have a number of tests that are not honoring the rule of not outputting their own name as a test name. I fixed up all the offenders i could find with the following regular expression: "(xfail|kfail|kpass|fail|pass|unsupported|untested) ([A-Za-z0-9]+|\\\$(.)*testfile(.)*)\.exp$" gdb/testsuite/ChangeLog: 2016-12-01 Luis Machado <lgustavo@codesourcery.com> Fix test names and standardize compilation error messages throughout the following files: * gdb.ada/start.exp * gdb.arch/alpha-step.exp * gdb.arch/e500-prologue.exp * gdb.arch/ftrace-insn-reloc.exp * gdb.arch/gdb1291.exp * gdb.arch/gdb1431.exp * gdb.arch/gdb1558.exp * gdb.arch/i386-dr3-watch.exp * gdb.arch/i386-sse-stack-align.exp * gdb.arch/ia64-breakpoint-shadow.exp * gdb.arch/pa-nullify.exp * gdb.arch/powerpc-aix-prologue.exp * gdb.arch/thumb-bx-pc.exp * gdb.base/annota1.exp * gdb.base/annota3.exp * gdb.base/arrayidx.exp * gdb.base/assign.exp * gdb.base/attach.exp * gdb.base/auxv.exp * gdb.base/bang.exp * gdb.base/bfp-test.exp * gdb.base/bigcore.exp * gdb.base/bitfields2.exp * gdb.base/break-fun-addr.exp * gdb.base/break-probes.exp * gdb.base/call-rt-st.exp * gdb.base/callexit.exp * gdb.base/catch-fork-kill.exp * gdb.base/charset.exp * gdb.base/checkpoint.exp * gdb.base/comprdebug.exp * gdb.base/constvars.exp * gdb.base/coredump-filter.exp * gdb.base/cursal.exp * gdb.base/cvexpr.exp * gdb.base/detach.exp * gdb.base/display.exp * gdb.base/dmsym.exp * gdb.base/dprintf-pending.exp * gdb.base/dso2dso.exp * gdb.base/dtrace-probe.exp * gdb.base/dump.exp * gdb.base/enum_cond.exp * gdb.base/exe-lock.exp * gdb.base/exec-invalid-sysroot.exp * gdb.base/execl-update-breakpoints.exp * gdb.base/exprs.exp * gdb.base/fileio.exp * gdb.base/find.exp * gdb.base/finish.exp * gdb.base/fixsection.exp * gdb.base/foll-vfork.exp * gdb.base/frame-args.exp * gdb.base/gcore.exp * gdb.base/gdb1250.exp * gdb.base/global-var-nested-by-dso.exp * gdb.base/gnu-ifunc.exp * gdb.base/hashline1.exp * gdb.base/hashline2.exp * gdb.base/hashline3.exp * gdb.base/hbreak-in-shr-unsupported.exp * gdb.base/huge.exp * gdb.base/infcall-input.exp * gdb.base/info-fun.exp * gdb.base/info-shared.exp * gdb.base/jit-simple.exp * gdb.base/jit-so.exp * gdb.base/jit.exp * gdb.base/jump.exp * gdb.base/label.exp * gdb.base/lineinc.exp * gdb.base/logical.exp * gdb.base/longjmp.exp * gdb.base/macscp.exp * gdb.base/miscexprs.exp * gdb.base/new-ui-echo.exp * gdb.base/new-ui-pending-input.exp * gdb.base/new-ui.exp * gdb.base/nodebug.exp * gdb.base/nofield.exp * gdb.base/offsets.exp * gdb.base/overlays.exp * gdb.base/pending.exp * gdb.base/pointers.exp * gdb.base/pr11022.exp * gdb.base/printcmds.exp * gdb.base/prologue.exp * gdb.base/ptr-typedef.exp * gdb.base/realname-expand.exp * gdb.base/relativedebug.exp * gdb.base/relocate.exp * gdb.base/remote.exp * gdb.base/reread.exp * gdb.base/return2.exp * gdb.base/savedregs.exp * gdb.base/sep.exp * gdb.base/sepdebug.exp * gdb.base/sepsymtab.exp * gdb.base/set-inferior-tty.exp * gdb.base/setshow.exp * gdb.base/shlib-call.exp * gdb.base/sigaltstack.exp * gdb.base/siginfo-addr.exp * gdb.base/signals.exp * gdb.base/signull.exp * gdb.base/sigrepeat.exp * gdb.base/so-impl-ld.exp * gdb.base/solib-display.exp * gdb.base/solib-overlap.exp * gdb.base/solib-search.exp * gdb.base/solib-symbol.exp * gdb.base/structs.exp * gdb.base/structs2.exp * gdb.base/symtab-search-order.exp * gdb.base/twice.exp * gdb.base/unload.exp * gdb.base/varargs.exp * gdb.base/watchpoint-solib.exp * gdb.base/watchpoint.exp * gdb.base/whatis.exp * gdb.base/wrong_frame_bt_full.exp * gdb.btrace/dlopen.exp * gdb.cell/ea-standalone.exp * gdb.cell/ea-test.exp * gdb.cp/dispcxx.exp * gdb.cp/gdb2384.exp * gdb.cp/method2.exp * gdb.cp/nextoverthrow.exp * gdb.cp/pr10728.exp * gdb.disasm/am33.exp * gdb.disasm/h8300s.exp * gdb.disasm/mn10300.exp * gdb.disasm/sh3.exp * gdb.dwarf2/dw2-dir-file-name.exp * gdb.fortran/complex.exp * gdb.fortran/library-module.exp * gdb.guile/scm-pretty-print.exp * gdb.guile/scm-symbol.exp * gdb.guile/scm-type.exp * gdb.guile/scm-value.exp * gdb.linespec/linespec.exp * gdb.mi/gdb701.exp * gdb.mi/gdb792.exp * gdb.mi/mi-breakpoint-changed.exp * gdb.mi/mi-dprintf-pending.exp * gdb.mi/mi-dprintf.exp * gdb.mi/mi-exit-code.exp * gdb.mi/mi-pending.exp * gdb.mi/mi-solib.exp * gdb.mi/new-ui-mi-sync.exp * gdb.mi/pr11022.exp * gdb.mi/user-selected-context-sync.exp * gdb.opt/solib-intra-step.exp * gdb.python/py-events.exp * gdb.python/py-finish-breakpoint.exp * gdb.python/py-mi.exp * gdb.python/py-prettyprint.exp * gdb.python/py-shared.exp * gdb.python/py-symbol.exp * gdb.python/py-template.exp * gdb.python/py-type.exp * gdb.python/py-value.exp * gdb.reverse/solib-precsave.exp * gdb.reverse/solib-reverse.exp * gdb.server/solib-list.exp * gdb.stabs/weird.exp * gdb.threads/reconnect-signal.exp * gdb.threads/stepi-random-signal.exp * gdb.trace/actions.exp * gdb.trace/ax.exp * gdb.trace/backtrace.exp * gdb.trace/change-loc.exp * gdb.trace/deltrace.exp * gdb.trace/ftrace-lock.exp * gdb.trace/ftrace.exp * gdb.trace/infotrace.exp * gdb.trace/mi-tracepoint-changed.exp * gdb.trace/packetlen.exp * gdb.trace/passcount.exp * gdb.trace/pending.exp * gdb.trace/range-stepping.exp * gdb.trace/report.exp * gdb.trace/stap-trace.exp * gdb.trace/tfind.exp * gdb.trace/trace-break.exp * gdb.trace/trace-condition.exp * gdb.trace/trace-enable-disable.exp * gdb.trace/trace-mt.exp * gdb.trace/tracecmd.exp * gdb.trace/tspeed.exp * gdb.trace/tsv.exp * lib/perftest.exp
2016-12-01 21:47:50 +01:00
untested "failed to compile"
* gdb.arch/altivec-abi.exp: Replace gdb_suppress_entire_file with untested followed by return combination. * gdb.arch/altivec-regs.exp: Likewise. * gdb.arch/e500-abi.exp: Likewise. * gdb.arch/e500-regs.exp: Likewise. * gdb.arch/gdb1291.exp: Likewise. * gdb.arch/gdb1431.exp: Likewise. * gdb.arch/gdb1558.exp: Likewise. * gdb.arch/i386-prologue.exp: Likewise. * gdb.arch/i386-unwind.exp: Likewise. * gdb.asm/asm-source.exp: Likewise. * gdb.base/a2-run.exp: Likewise. * gdb.base/advance.exp: Likewise. * gdb.base/all-bin.exp: Likewise. * gdb.base/annota1.exp: Likewise. * gdb.base/annota3.exp: Likewise. * gdb.base/args.exp: Likewise. * gdb.base/arithmet.exp: Likewise. * gdb.base/assign.exp: Likewise. * gdb.base/async.exp: Likewise. * gdb.base/attach.exp: Likewise. * gdb.base/bang.exp: Likewise. * gdb.base/bigcore.exp: Likewise. * gdb.base/bitfields.exp: Likewise. * gdb.base/bitfields2.exp: Likewise. * gdb.base/break.exp: Likewise. * gdb.base/call-sc.exp: Likewise. * gdb.base/call-strs.exp: Likewise. * gdb.base/callfuncs.exp: Likewise. * gdb.base/checkpoint.exp: Likewise. * gdb.base/chng-syms.exp: Likewise. * gdb.base/code-expr.exp: Likewise. * gdb.base/commands.exp: Likewise. * gdb.base/completion.exp: Likewise. * gdb.base/cond-expr.exp: Likewise. * gdb.base/condbreak.exp: Likewise. * gdb.base/consecutive.exp: Likewise. * gdb.base/constvars.exp: Likewise. * gdb.base/corefile.exp: Likewise. * gdb.base/cvexpr.exp: Likewise. * gdb.base/dbx.exp: Likewise. * gdb.base/define.exp: Likewise. * gdb.base/detach.exp: Likewise. * gdb.base/display.exp: Likewise. * gdb.base/dump.exp: Likewise. * gdb.base/ena-dis-br.exp: Likewise. * gdb.base/ending-run.exp: Likewise. * gdb.base/environ.exp: Likewise. * gdb.base/eval-skip.exp: Likewise. * gdb.base/exprs.exp: Likewise. * gdb.base/fileio.exp: Likewise. * gdb.base/finish.exp: Likewise. * gdb.base/float.exp: Likewise. * gdb.base/foll-exec.exp: Likewise. * gdb.base/foll-fork.exp: Likewise. * gdb.base/foll-vfork.exp: Likewise. * gdb.base/freebpcmd.exp: Likewise. * gdb.base/funcargs.exp: Likewise. * gdb.base/gcore.exp: Likewise. * gdb.base/gdb1090.exp: Likewise. * gdb.base/gdb1250.exp: Likewise. * gdb.base/huge.exp: Likewise. * gdb.base/info-proc.exp: Likewise. * gdb.base/interrupt.exp: Likewise. * gdb.base/jump.exp: Likewise. * gdb.base/langs.exp: Likewise. * gdb.base/lineinc.exp: Likewise. * gdb.base/list.exp: Likewise. * gdb.base/logical.exp: Likewise. * gdb.base/long_long.exp: Likewise. * gdb.base/macscp.exp: Likewise. * gdb.base/maint.exp: Likewise. * gdb.base/mips_pro.exp: Likewise. * gdb.base/miscexprs.exp: Likewise. * gdb.base/multi-forks.exp: Likewise. * gdb.base/opaque.exp: Likewise. * gdb.base/overlays.exp: Likewise. * gdb.base/pc-fp.exp: Likewise. * gdb.base/pointers.exp: Likewise. * gdb.base/printcmds.exp: Likewise. * gdb.base/psymtab.exp: Likewise. * gdb.base/ptype.exp: Likewise. * gdb.base/recurse.exp: Likewise. * gdb.base/relational.exp: Likewise. * gdb.base/relocate.exp: Likewise. * gdb.base/remote.exp: Likewise. * gdb.base/reread.exp: Likewise. * gdb.base/restore.exp: Likewise. * gdb.base/return.exp: Likewise. * gdb.base/return2.exp: Likewise. * gdb.base/scope.exp: Likewise. * gdb.base/sect-cmd.exp: Likewise. * gdb.base/sep.exp: Likewise. * gdb.base/sepdebug.exp: Likewise. * gdb.base/setshow.exp: Likewise. * gdb.base/setvar.exp: Likewise. * gdb.base/sigall.exp: Likewise. * gdb.base/sigbpt.exp: Likewise. * gdb.base/signals.exp: Likewise. * gdb.base/signull.exp: Likewise. * gdb.base/sizeof.exp: Likewise. * gdb.base/solib.exp: Likewise. * gdb.base/step-line.exp: Likewise. * gdb.base/step-test.exp: Likewise. * gdb.base/structs.exp: Likewise. * gdb.base/structs2.exp: Likewise. * gdb.base/term.exp: Likewise. * gdb.base/twice.exp: Likewise. * gdb.base/until.exp: Likewise. * gdb.base/varargs.exp: Likewise. * gdb.base/volatile.exp: Likewise. * gdb.base/watchpoint.exp: Likewise. * gdb.base/whatis-exp.exp: Likewise. * gdb.base/whatis.exp: Likewise. * gdb.cp/ambiguous.exp: Likewise. * gdb.cp/annota2.exp: Likewise. * gdb.cp/annota3.exp: Likewise. * gdb.cp/bool.exp: Likewise. * gdb.cp/breakpoint.exp: Likewise. * gdb.cp/casts.exp: Likewise. * gdb.cp/class2.exp: Likewise. * gdb.cp/classes.exp: Likewise. * gdb.cp/cplusfuncs.exp: Likewise. * gdb.cp/ctti.exp: Likewise. * gdb.cp/derivation.exp: Likewise. * gdb.cp/exception.exp: Likewise. * gdb.cp/gdb1355.exp: Likewise. * gdb.cp/hang.exp: Likewise. * gdb.cp/inherit.exp: Likewise. * gdb.cp/local.exp: Likewise. * gdb.cp/m-data.exp: Likewise. * gdb.cp/m-static.exp: Likewise. * gdb.cp/member-ptr.exp: Likewise. * gdb.cp/method.exp: Likewise. * gdb.cp/misc.exp: Likewise. * gdb.cp/namespace.exp: Likewise. * gdb.cp/overload.exp: Likewise. * gdb.cp/ovldbreak.exp: Likewise. * gdb.cp/pr-1023.exp: Likewise. * gdb.cp/pr-1210.exp: Likewise. * gdb.cp/pr-574.exp: Likewise. * gdb.cp/printmethod.exp: Likewise. * gdb.cp/psmang.exp: Likewise. * gdb.cp/ref-params.exp: Likewise. * gdb.cp/ref-types.exp: Likewise. * gdb.cp/rtti.exp: Likewise. * gdb.cp/templates.exp: Likewise. * gdb.cp/try_catch.exp: Likewise. * gdb.cp/userdef.exp: Likewise. * gdb.cp/virtfunc.exp: Likewise. * gdb.disasm/am33.exp: Likewise. * gdb.disasm/h8300s.exp: Likewise. * gdb.disasm/mn10300.exp: Likewise. * gdb.disasm/sh3.exp: Likewise. * gdb.disasm/t01_mov.exp: Likewise. * gdb.disasm/t02_mova.exp: Likewise. * gdb.disasm/t03_add.exp: Likewise. * gdb.disasm/t04_sub.exp: Likewise. * gdb.disasm/t05_cmp.exp: Likewise. * gdb.disasm/t06_ari2.exp: Likewise. * gdb.disasm/t07_ari3.exp: Likewise. * gdb.disasm/t08_or.exp: Likewise. * gdb.disasm/t09_xor.exp: Likewise. * gdb.disasm/t10_and.exp: Likewise. * gdb.disasm/t11_logs.exp: Likewise. * gdb.disasm/t12_bit.exp: Likewise. * gdb.disasm/t13_otr.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/dollar.exp: Likewise. * gdb.hp/gdb.base-hp/hwwatchbus.exp: Likewise. * gdb.hp/gdb.base-hp/pxdb.exp: Likewise. * gdb.hp/gdb.base-hp/reg-pa64.exp: Likewise. * gdb.hp/gdb.base-hp/reg.exp: Likewise. * gdb.hp/gdb.base-hp/sized-enum.exp: Likewise. * gdb.hp/gdb.compat/xdb1.exp: Likewise. * gdb.hp/gdb.compat/xdb3.exp: Likewise. * gdb.hp/gdb.objdbg/objdbg01.exp: Likewise. * gdb.hp/gdb.objdbg/objdbg02.exp: Likewise. * gdb.hp/gdb.objdbg/objdbg03.exp: Likewise. * gdb.hp/gdb.objdbg/objdbg04.exp: Likewise. * gdb.mi/gdb701.exp: Likewise. * gdb.mi/gdb792.exp: Likewise. * gdb.mi/mi-basics.exp: Likewise. * gdb.mi/mi-break.exp: Likewise. * gdb.mi/mi-cli.exp: Likewise. * gdb.mi/mi-console.exp: Likewise. * gdb.mi/mi-disassemble.exp: Likewise. * gdb.mi/mi-eval.exp: Likewise. * gdb.mi/mi-file.exp: Likewise. * gdb.mi/mi-read-memory.exp: Likewise. * gdb.mi/mi-regs.exp: Likewise. * gdb.mi/mi-return.exp: Likewise. * gdb.mi/mi-simplerun.exp: Likewise. * gdb.mi/mi-stack.exp: Likewise. * gdb.mi/mi-stepi.exp: Likewise. * gdb.mi/mi-syn-frame.exp: Likewise. * gdb.mi/mi-until.exp: Likewise. * gdb.mi/mi-var-block.exp: Likewise. * gdb.mi/mi-var-child.exp: Likewise. * gdb.mi/mi-var-cmd.exp: Likewise. * gdb.mi/mi-var-display.exp: Likewise. * gdb.mi/mi-watch.exp: Likewise. * gdb.mi/mi2-basics.exp: Likewise. * gdb.mi/mi2-break.exp: Likewise. * gdb.mi/mi2-cli.exp: Likewise. * gdb.mi/mi2-console.exp: Likewise. * gdb.mi/mi2-disassemble.exp: Likewise. * gdb.mi/mi2-eval.exp: Likewise. * gdb.mi/mi2-file.exp: Likewise. * gdb.mi/mi2-read-memory.exp: Likewise. * gdb.mi/mi2-regs.exp: Likewise. * gdb.mi/mi2-return.exp: Likewise. * gdb.mi/mi2-simplerun.exp: Likewise. * gdb.mi/mi2-stack.exp: Likewise. * gdb.mi/mi2-stepi.exp: Likewise. * gdb.mi/mi2-syn-frame.exp: Likewise. * gdb.mi/mi2-until.exp: Likewise. * gdb.mi/mi2-var-block.exp: Likewise. * gdb.mi/mi2-var-child.exp: Likewise. * gdb.mi/mi2-var-cmd.exp: Likewise. * gdb.mi/mi2-var-display.exp: Likewise. * gdb.mi/mi2-watch.exp: Likewise. * gdb.stabs/exclfwd.exp: Likewise. * gdb.stabs/weird.exp: Likewise. * gdb.threads/gcore-thread.exp: Likewise. * gdb.trace/actions.exp: Likewise. * gdb.trace/backtrace.exp: Likewise. * gdb.trace/circ.exp: Likewise. * gdb.trace/collection.exp: Likewise. * gdb.trace/deltrace.exp: Likewise. * gdb.trace/infotrace.exp: Likewise. * gdb.trace/limits.exp: Likewise. * gdb.trace/packetlen.exp: Likewise. * gdb.trace/passc-dyn.exp: Likewise. * gdb.trace/passcount.exp: Likewise. * gdb.trace/report.exp: Likewise. * gdb.trace/save-trace.exp: Likewise. * gdb.trace/tfind.exp: Likewise. * gdb.trace/tracecmd.exp: Likewise. * gdb.trace/while-dyn.exp: Likewise. * gdb.trace/while-stepping.exp: Likewise.
2006-08-10 07:27:22 +02:00
return -1
}
clean_restart ${binfile}
# The commands we test here produce many lines of output; disable "press
# <return> to continue" prompts.
gdb_test_no_output "set height 0"
#
Fix fail in gdb.base/annota1.exp and gdb.base/annota3.exp Hi, I am seeing the fail below on aarch64-linux with gcc 4.9.2, break main Breakpoint 1 at 0x4006e8: file binutils-gdb/gdb/testsuite/gdb.base/annota1.c, line 14.^M (gdb) FAIL: gdb.base/annota1.exp: breakpoint main the test expects the breakpoint is set on line 15. Let us look at the main function, 12 int 13 main (void) 14 { 15 int my_array[3] = { 1, 2, 3 }; /* break main */ 16 17 value = 7; 18 19 #ifdef SIGUSR1 20 signal (SIGUSR1, handle_USR1); 21 #endif (gdb) disassemble main Dump of assembler code for function main: 0x00000000004006e0 <+0>: stp x29, x30, [sp,#-48]! 0x00000000004006e4 <+4>: mov x29, sp 0x00000000004006e8 <+8>: adrp x0, 0x411000 <signal@got.plt> 0x00000000004006ec <+12>: add x0, x0, #0x40 the breakpoint is set on the right address after skipping prologue, but 0x00000000004006e8 is mapped to the line 14, as shown below, (gdb) maintenance info line-table objfile: /home/yao.qi/source/build-aarch64/gdb/testsuite/outputs/gdb.base/annota1/annota1 ((struct objfile *) 0x2b0e1850) compunit_symtab: ((struct compunit_symtab *) 0x2b0ded50) symtab: /home/yao.qi/source/binutils-gdb/gdb/testsuite/gdb.base/annota1.c ((struct symtab *) 0x2b0dedd0) linetable: ((struct linetable *) 0x2b12c8b0): INDEX LINE ADDRESS 0 7 0x00000000004006d0 1 8 0x00000000004006d8 2 14 0x00000000004006e0 3 14 0x00000000004006e8 4 15 0x00000000004006fc so GDB does nothing wrong. Program hits breakpoint on either line 14 or line 15 is right to me. With anther gcc (4.9.3), the line-table looks correct, and no test fail. Instead of setting breakpoint on main and assuming the line is what we get from the source, we can set breakpoint on that line. On the other hand, the test prints the values of the array and check, so we need to set breakpoint on the line setting the values of array and "next", rather than setting the breakpoint on main. gdb/testsuite: 2016-04-22 Yao Qi <yao.qi@linaro.org> * gdb.base/annota1.exp: Set breakpoint on line $main_line. * gdb.base/annota3.exp: Likewise.
2016-04-22 16:35:07 +02:00
# break in main
#
set main_line [gdb_get_line_number "break main"]
Fix fail in gdb.base/annota1.exp and gdb.base/annota3.exp Hi, I am seeing the fail below on aarch64-linux with gcc 4.9.2, break main Breakpoint 1 at 0x4006e8: file binutils-gdb/gdb/testsuite/gdb.base/annota1.c, line 14.^M (gdb) FAIL: gdb.base/annota1.exp: breakpoint main the test expects the breakpoint is set on line 15. Let us look at the main function, 12 int 13 main (void) 14 { 15 int my_array[3] = { 1, 2, 3 }; /* break main */ 16 17 value = 7; 18 19 #ifdef SIGUSR1 20 signal (SIGUSR1, handle_USR1); 21 #endif (gdb) disassemble main Dump of assembler code for function main: 0x00000000004006e0 <+0>: stp x29, x30, [sp,#-48]! 0x00000000004006e4 <+4>: mov x29, sp 0x00000000004006e8 <+8>: adrp x0, 0x411000 <signal@got.plt> 0x00000000004006ec <+12>: add x0, x0, #0x40 the breakpoint is set on the right address after skipping prologue, but 0x00000000004006e8 is mapped to the line 14, as shown below, (gdb) maintenance info line-table objfile: /home/yao.qi/source/build-aarch64/gdb/testsuite/outputs/gdb.base/annota1/annota1 ((struct objfile *) 0x2b0e1850) compunit_symtab: ((struct compunit_symtab *) 0x2b0ded50) symtab: /home/yao.qi/source/binutils-gdb/gdb/testsuite/gdb.base/annota1.c ((struct symtab *) 0x2b0dedd0) linetable: ((struct linetable *) 0x2b12c8b0): INDEX LINE ADDRESS 0 7 0x00000000004006d0 1 8 0x00000000004006d8 2 14 0x00000000004006e0 3 14 0x00000000004006e8 4 15 0x00000000004006fc so GDB does nothing wrong. Program hits breakpoint on either line 14 or line 15 is right to me. With anther gcc (4.9.3), the line-table looks correct, and no test fail. Instead of setting breakpoint on main and assuming the line is what we get from the source, we can set breakpoint on that line. On the other hand, the test prints the values of the array and check, so we need to set breakpoint on the line setting the values of array and "next", rather than setting the breakpoint on main. gdb/testsuite: 2016-04-22 Yao Qi <yao.qi@linaro.org> * gdb.base/annota1.exp: Set breakpoint on line $main_line. * gdb.base/annota3.exp: Likewise.
2016-04-22 16:35:07 +02:00
gdb_test "break ${srcfile}:${main_line}" \
"Breakpoint.*at.* file .*$srcfile, line $main_line\\." \
"breakpoint main"
# NOTE: this prompt is OK only when the annotation level is > 1
# NOTE: When this prompt is in use the gdb_test procedure cannot be
# used because it assumes that the last char after the gdb_prompt is a
# white space. This is not true with this annotated prompt. So we must
# use send_gdb and gdb_expect or gdb_expect_list.
set old_gdb_prompt $gdb_prompt
set gdb_prompt "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n"
#
# set the annotation level to 3
#
# of course, this will test:
# annotate-pre-prompt
# annotate-prompt
# annotate-post-prompt (in the next block)
#
send_gdb "set annotate 3\n"
gdb_expect_list "annotation set at level 3" "\r\n$gdb_prompt$" {
"set annotate 3"
}
#
# if construct:
#
gdb_test_multiple "if 1" "start if construct" {
-re "^if 1\r\n\r\n\032\032post-prompt\r\n\r\n\032\032pre-commands\r\n >\r\n\032\032commands\r\n$" {
pass "start if construct"
}
}
gdb_test_multiple "end" "end if construct" {
-re "^end\r\n\r\n\032\032post-commands\r\n$gdb_prompt$" {
pass "end if construct"
}
}
#
# info break:
#
send_gdb "info break\n"
gdb_expect_list "breakpoint info" "$gdb_prompt$" [concat {
"\r\n\032\032post-prompt\r\n"
"Num Type Disp Enb Address +What\r\n" } [list \
"1 breakpoint keep y 0x\[0-9a-zA-Z\]+ +in main at .*annota3.c:$main_line\r\n"]]
#
# run to a break point will test:
#
#exp_internal 1
send_gdb "run\n"
gdb_expect_list "run until main breakpoint" "$gdb_prompt$" [concat {
"\r\n\032\032post-prompt\r\n"
"Starting program: .*annota3(|\.exe) \r\n"
"\r\n\032\032starting\r\n"
"\r\n\032\032breakpoint 1\r\n"
"\r\n"
2006-07-17 09:29:47 +02:00
"Breakpoint 1, "
"\r\n\032\032frame-begin 0 0x\[0-9a-z\]+\r\n" } [list \
"main \\(\\) at .*annota3.c:$main_line\r\n"] [list \
"\r\n\032\032source.*annota3.c:$main_line:.*:beg:0x\[0-9a-z\]+\r\n"] {
"\r\n\032\032stopped\r\n"
}]
#exp_internal 0
#exit 0
#
# Let's do a next, to get to a point where the array is initialized
# We don't care about the annotated output for this operation, it is the same as
# the one produced by run above
#
send_gdb "next\n"
gdb_expect_list "go after array init line" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
"\r\n\032\032starting\r\n"
"\r\n\032\032source .*annota3.c:\[0-9\]+:\[0-9\]+:beg:0x\[0-9a-z\]+\r\n"
"\r\n\032\032stopped\r\n"
}
#
# printing the array:
#
send_gdb "print my_array\n"
gdb_expect_list "print array" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
".*= .1, 2, 3.\r\n"
}
#
# this should generate an error message, so to test:
# annotate-error-begin
# FIXME: annotate-error not tested
#
#exp_internal 1
send_gdb "print non_existent_value\n"
gdb_expect_list "print non_existent_value" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
"\r\n\032\032error-begin\r\n"
"No symbol \"non_existent_value\" in current context.\r\n"
"\r\n\032\032error\r\n"
}
#
# break at signal handler
#
send_gdb "break handle_USR1\n"
gdb_expect_list "breakpoint handle_USR1" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
"Breakpoint.*at 0x\[0-9a-z\]+: file.*annota3.c, line.*\r\n"
}
#
# break at printf. When we are stopped at printf, we can test
#
send_gdb "break printf\n"
gdb_expect_list "breakpoint printf" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
"Breakpoint.*at 0x\[0-9a-z\]+.*"
}
#
# get to printf
#
send_gdb "continue\n"
gdb_expect_list "continue to printf" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
"Continuing.\r\n"
"\r\n\032\032starting\r\n"
"\r\n\032\032breakpoint 3\r\n"
"\r\n"
"Breakpoint 3, \[^\r\n\]*\r\n"
"\r\n\032\032stopped\r\n"
}
send_gdb "backtrace\n"
gdb_expect_list "backtrace from shlibrary" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
"#0 .* .*printf(@\[^ ]*)? \[^\r\n\]*\r\n"
"#1 .* main \[^\r\n\]*\r\n"
}
#
# test printing a frame with some arguments:
#
if [target_info exists gdb,nosignals] {
unsupported "send SIGUSR1"
unsupported "backtrace @ signal handler"
} else {
send_gdb "signal SIGUSR1\n"
gdb_expect_list "send SIGUSR1" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
"Continuing with signal SIGUSR1.\r\n"
"\r\n\032\032starting\r\n"
"\r\n\032\032breakpoint 2\r\n"
2006-07-17 09:29:47 +02:00
"\r\n"
"Breakpoint 2, "
"\r\n\032\032frame-begin 0 0x\[0-9a-z\]+\r\n"
"handle_USR1 \\(sig=\[0-9\]+\\) at .*annota3.c:\[0-9\]+\r\n"
"\r\n\032\032source .*annota3.c:\[0-9\]+:\[0-9\]+:beg:0x\[0-9a-z\]+\r\n"
"\r\n\032\032stopped\r\n"
}
#
# test:
#
send_gdb "backtrace\n"
gdb_expect_list "backtrace @ signal handler" "$gdb_prompt$" {
"#0 +handle_USR1 \[^\r\n\]+\r\n"
"#1 +.signal handler called.\r\n"
"#2 .* .*printf(@\[^ \]*)? \[^\r\n\]+\r\n"
"#3 .* main \[^\r\n\]+\r\n"
}
}
#
# delete all the breakpoints
#
send_gdb "delete 1\n"
gdb_expect_list "delete bp 1" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
}
send_gdb "delete 2\n"
gdb_expect_list "delete bp 2" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
}
send_gdb "delete 3\n"
gdb_expect_list "delete bp 3" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
}
#
Fix fail in gdb.base/annota1.exp and gdb.base/annota3.exp Hi, I am seeing the fail below on aarch64-linux with gcc 4.9.2, break main Breakpoint 1 at 0x4006e8: file binutils-gdb/gdb/testsuite/gdb.base/annota1.c, line 14.^M (gdb) FAIL: gdb.base/annota1.exp: breakpoint main the test expects the breakpoint is set on line 15. Let us look at the main function, 12 int 13 main (void) 14 { 15 int my_array[3] = { 1, 2, 3 }; /* break main */ 16 17 value = 7; 18 19 #ifdef SIGUSR1 20 signal (SIGUSR1, handle_USR1); 21 #endif (gdb) disassemble main Dump of assembler code for function main: 0x00000000004006e0 <+0>: stp x29, x30, [sp,#-48]! 0x00000000004006e4 <+4>: mov x29, sp 0x00000000004006e8 <+8>: adrp x0, 0x411000 <signal@got.plt> 0x00000000004006ec <+12>: add x0, x0, #0x40 the breakpoint is set on the right address after skipping prologue, but 0x00000000004006e8 is mapped to the line 14, as shown below, (gdb) maintenance info line-table objfile: /home/yao.qi/source/build-aarch64/gdb/testsuite/outputs/gdb.base/annota1/annota1 ((struct objfile *) 0x2b0e1850) compunit_symtab: ((struct compunit_symtab *) 0x2b0ded50) symtab: /home/yao.qi/source/binutils-gdb/gdb/testsuite/gdb.base/annota1.c ((struct symtab *) 0x2b0dedd0) linetable: ((struct linetable *) 0x2b12c8b0): INDEX LINE ADDRESS 0 7 0x00000000004006d0 1 8 0x00000000004006d8 2 14 0x00000000004006e0 3 14 0x00000000004006e8 4 15 0x00000000004006fc so GDB does nothing wrong. Program hits breakpoint on either line 14 or line 15 is right to me. With anther gcc (4.9.3), the line-table looks correct, and no test fail. Instead of setting breakpoint on main and assuming the line is what we get from the source, we can set breakpoint on that line. On the other hand, the test prints the values of the array and check, so we need to set breakpoint on the line setting the values of array and "next", rather than setting the breakpoint on main. gdb/testsuite: 2016-04-22 Yao Qi <yao.qi@linaro.org> * gdb.base/annota1.exp: Set breakpoint on line $main_line. * gdb.base/annota3.exp: Likewise.
2016-04-22 16:35:07 +02:00
# break in main, after value is initialized. This is in preparation
# to test the annotate output for the display command.
#
Fix fail in gdb.base/annota1.exp and gdb.base/annota3.exp Hi, I am seeing the fail below on aarch64-linux with gcc 4.9.2, break main Breakpoint 1 at 0x4006e8: file binutils-gdb/gdb/testsuite/gdb.base/annota1.c, line 14.^M (gdb) FAIL: gdb.base/annota1.exp: breakpoint main the test expects the breakpoint is set on line 15. Let us look at the main function, 12 int 13 main (void) 14 { 15 int my_array[3] = { 1, 2, 3 }; /* break main */ 16 17 value = 7; 18 19 #ifdef SIGUSR1 20 signal (SIGUSR1, handle_USR1); 21 #endif (gdb) disassemble main Dump of assembler code for function main: 0x00000000004006e0 <+0>: stp x29, x30, [sp,#-48]! 0x00000000004006e4 <+4>: mov x29, sp 0x00000000004006e8 <+8>: adrp x0, 0x411000 <signal@got.plt> 0x00000000004006ec <+12>: add x0, x0, #0x40 the breakpoint is set on the right address after skipping prologue, but 0x00000000004006e8 is mapped to the line 14, as shown below, (gdb) maintenance info line-table objfile: /home/yao.qi/source/build-aarch64/gdb/testsuite/outputs/gdb.base/annota1/annota1 ((struct objfile *) 0x2b0e1850) compunit_symtab: ((struct compunit_symtab *) 0x2b0ded50) symtab: /home/yao.qi/source/binutils-gdb/gdb/testsuite/gdb.base/annota1.c ((struct symtab *) 0x2b0dedd0) linetable: ((struct linetable *) 0x2b12c8b0): INDEX LINE ADDRESS 0 7 0x00000000004006d0 1 8 0x00000000004006d8 2 14 0x00000000004006e0 3 14 0x00000000004006e8 4 15 0x00000000004006fc so GDB does nothing wrong. Program hits breakpoint on either line 14 or line 15 is right to me. With anther gcc (4.9.3), the line-table looks correct, and no test fail. Instead of setting breakpoint on main and assuming the line is what we get from the source, we can set breakpoint on that line. On the other hand, the test prints the values of the array and check, so we need to set breakpoint on the line setting the values of array and "next", rather than setting the breakpoint on main. gdb/testsuite: 2016-04-22 Yao Qi <yao.qi@linaro.org> * gdb.base/annota1.exp: Set breakpoint on line $main_line. * gdb.base/annota3.exp: Likewise.
2016-04-22 16:35:07 +02:00
send_gdb "break ${srcfile}:${main_line}\n"
gdb_expect_list "break in main" "$gdb_prompt$" [concat {
"\r\n\032\032post-prompt\r\n" } [list \
"Breakpoint 4 at 0x\[0-9a-z\]+: file .*annota3.c, line $main_line.\r\n"]]
#
# display the value
#
send_gdb "display value\n"
gdb_expect_list "set up display" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
"1: value = 7\r\n"
}
# should ask query. Test annotate-query.
# we don't care about anything else here, only the query.
send_gdb "run\n"
gdb_expect {
-re "pre-query.*already.*\\(y or n\\).*query\r\n" {
send_gdb "y\n"
gdb_expect {
-re ".*post-query.*$gdb_prompt$" \
{ pass "re-run" }
-re ".*$gdb_prompt$" { fail "re-run" }
timeout { fail "re-run (timeout)" }
}
}
-re ".*$gdb_prompt$" { fail "re-run" }
timeout { fail "re-run (timeout)" }
}
#
# Test that breakpoints-invalid is issued once and only once for
# breakpoint ignore count changes, after annotation stopped.
# NOTE: breakpoints-invalid annotations have been removed from
# level 3 but keep these tests for continuity and comparison
# with annota1.exp.
set value_inc_line [gdb_get_line_number "increment value"]
send_gdb "break $value_inc_line\n"
gdb_expect_list "break at value++" "$gdb_prompt$" [concat {
"\r\n\032\032post-prompt\r\n" } [list \
"Breakpoint 5 at 0x\[0-9a-z\]+: file .*annota3.c, line $value_inc_line.\r\n"]]
send_gdb "ignore 5 4\n"
gdb_expect_list "ignore 5 4" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
"Will ignore next 4 crossings of breakpoint 5"
"\r\n"
}
send_gdb "continue\n"
gdb_expect_list "annotate ignore count change" "$gdb_prompt$" [concat {
"\r\n\032\032post-prompt\r\n"
"\r\n\032\032breakpoint 5\r\n"
2006-07-17 09:29:47 +02:00
"\r\n"
"Breakpoint 5, "
"\r\n\032\032frame-begin 0 0x\[0-9a-z\]+\r\n" } [list \
"main \\(\\) at .*annota3.c:$value_inc_line\r\n"] [list \
"\r\n\032\032source .*annota3.c:$value_inc_line:\[0-9\]+:beg:0x\[0-9a-z\]+\r\n"] {
"1: value = 11\r\n"
"\r\n\032\032stopped\r\n"
}]
# check that ignore command is working, or the above can provide
# misleading assurance ...
send_gdb "next\n"
gdb_expect_list "next to exit loop" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
"\r\n\032\032starting\r\n"
"\r\n\032\032source.*annota3.c:\[0-9\]+:\[0-9\]+:beg:0x\[0-9a-z\]+\r\n"
"1: value = 12\r\n"
"\r\n\032\032stopped\r\n"
}
set after_loop_line [gdb_get_line_number "after loop"]
send_gdb "next\n"
gdb_expect_list "breakpoint ignore count" "$gdb_prompt$" [concat {
"\r\n\032\032post-prompt\r\n"
"\r\n\032\032starting\r\n" } [list \
"\r\n\032\032source.*annota3.c:$after_loop_line:\[0-9\]+:beg:0x\[0-9a-z\]+\r\n"] {
"1: value = 12\r\n"
"\r\n\032\032stopped\r\n"
}]
# Get the inferior's PID for later.
set test "get inferior pid"
set pid -1
gdb_test_multiple "info inferior 1" "$test" {
-re "process (\[0-9\]*).*$gdb_prompt$" {
set pid $expect_out(1,string)
pass "$test"
}
}
# Send a signal that is not handled
if [target_info exists gdb,nosignals] {
unsupported "signal sent"
} else {
send_gdb "signal SIGTRAP\n"
gdb_expect_list "signal sent" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
"Continuing with signal SIGTRAP.\r\n"
"\r\n\032\032starting\r\n"
"\r\n\032\032signalled\r\n"
"\r\nProgram terminated with signal SIGTRAP, Trace.breakpoint trap.\r\n"
"The program no longer exists.\r\n"
"\r\n\032\032stopped\r\n"
}
}
# Check for production of a core file and remove it!
set test "cleanup core file"
if { [remote_file host exists core] } {
remote_file host delete core
pass "$test (removed)"
} elseif { $pid != -1 && [remote_file host exists core.$pid] } {
remote_file host delete core.$pid
pass "$test (removed)"
} else {
pass "$test (not dumped)"
}
# restore the original prompt for the rest of the testsuite
set gdb_prompt $old_gdb_prompt