This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug testsuite/15986] New: gdb.base/commands.exp: expected line should be updated


https://sourceware.org/bugzilla/show_bug.cgi?id=15986

            Bug ID: 15986
           Summary: gdb.base/commands.exp: expected line should be updated
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: testsuite
          Assignee: unassigned at sourceware dot org
          Reporter: akolesov at synopsys dot com

Created attachment 7220
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7220&action=edit
Suggested patch

Hi All,

gdb.base/commands.exp:watchpoint_command_test() should be updated with another
expected line. In "continue with watch" test there should be lines 53|78
instead of 53|77. This is reproducible on x86_64 host, but only if hardware
watchpoints are disabled, otherwise test will stop at line 53, not 77-78:

$ gcc -DFAKEARGV -g gdb/testsuite/gdb.base/run.c -o
gdb/testsuite/gdb.base/commands

$ gdb/gdb gdb/testsuite/gdb.base/commands
Python Exception <type 'exceptions.ImportError'> No module named gdb: 

warning: 
Could not load the Python gdb module from `/usr/local/share/gdb/python'.
Limited Python support is available from the _gdb module.
Suggest passing --data-directory=/path/to/gdb/data-directory.

GNU gdb (GDB) 7.6.50.20130930-cvs
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gdb/testsuite/gdb.base/commands...done.
(gdb) set can-use-hw-watchpoints 0
(gdb) b factorial
Breakpoint 1 at 0x40050e: file gdb/testsuite/gdb.base/run.c, line 73.
(gdb) run
Starting program:
/home/akolesov/gnu-upstream/gdb/gdb/testsuite/gdb.base/commands 

Breakpoint 1, factorial (value=1) at gdb/testsuite/gdb.base/run.c:73
73        if (value > 1) {
(gdb) watch local_var
Watchpoint 2: local_var
(gdb) commands 2
Type commands for breakpoint(s) 2, one per line.
End with a line saying just "end".
>print value
>continue
>end
(gdb) c
Continuing.
Watchpoint 2: local_var

Old value = 0
New value = 1
factorial (value=1) at gdb/testsuite/gdb.base/run.c:77
77        return (value);
$1 = 1

Watchpoint 2 deleted because the program has left the block in
which its expression is valid.
0x0000000000400539 in factorial (value=<error reading variable: can't compute
CFA for this frame>) at gdb/testsuite/gdb.base/run.c:78
78    }
(gdb)


commands.exp expects line 77, but it is line 78. Attached patch fixes it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]