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/19127] func sum and func print_average fail in dbx.exp


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

--- Comment #2 from Stephen Kim <stephen.kim at oracle dot com> ---
The last comment was 2015-10-14. As of Sep. 24th 2017 in Tokyo time, I have
done the following, and it does not look like the bug is reproducible. If I am
mistaken somewhere, please, let me know.

1. arm-none-eabi-gcc/g++
  - Downloaded binaries from
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads

2. gdb
 a. as of the date above, git clone as follows:
  git clone git://sourceware.org/git/binutils-gdb.git gdb_arm
 b. configure'd as follows:
  mkdir build
  cd build; ../configure --target=arm-none-eabi --with-libexpat --with-lzma=no
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --with-python=no
 c. make

After 1 and 2 are done, the following command was run and 5 failures were
reported:
  make check RUNTESTFLAGS="CFLAGS_FOR_TARGET='--specs=nosys.specs' 
gdb.base/dbx.exp"

However, when I looked into the gdb.log, it seems like all failures were due to
that the debugee was not really running. According to the gdb.log from another
gdb on and for x86, I tried to run the gdb commands in the test case one by
one.

Only that I should have added 'target sim' and 'load' command. Please, see
below:

aion1223@localhost ~/workspace/srcs/gdb_arm/build $ 
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/../../gdb/gdb -nw -nx
-data-directory
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/../data-directory
--dbx
GNU gdb (GDB) 8.0.50.20170924-git
Copyright (C) 2017 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 "--host=x86_64-linux-gnu --target=arm-none-eabi".
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".
(gdb)  set height 0
(gdb)  set width 0
(gdb) use
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb)  use
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/../../../gdb/testsuite/gdb.base
Source directories searched:
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/../../../gdb/testsuite/gdb.base:$cdir:$cwd
(gdb)  symbol-file
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/outputs/gdb.base/dbx/dbx
Reading symbols from
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/outputs/gdb.base/dbx/dbx...done.
(gdb) exec-file
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/outputs/gdb.base/dbx/dbx
(gdb) stop in main
Breakpoint 1 at 0x82d8: file
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/../../../gdb/testsuite/gdb.base/average.c,
line 25.
(gdb) status
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0x000082d8 in main at
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/../../../gdb/testsuite/gdb.base/average.c:25
(gdb) stop at average.c:30
Breakpoint 2 at 0x8300: file
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/../../../gdb/testsuite/gdb.base/average.c,
line 30.
(gdb) stop in average.c:30
Usage: stop in <function | address>
(gdb) stop at main
Usage: stop at <line>
(gdb) run
Don't know how to run.  Try "help target".
(gdb) target sim
Connected to the simulator.
(gdb) load
Loading section .init, size 0x18 lma 0x8000
Loading section .text, size 0xa844 lma 0x8018
Loading section .fini, size 0x18 lma 0x1285c
Loading section .rodata, size 0x2d5 lma 0x12878
Loading section .ARM.exidx, size 0x8 lma 0x12b50
Loading section .eh_frame, size 0x4 lma 0x12b58
Loading section .init_array, size 0x8 lma 0x22b5c
Loading section .fini_array, size 0x4 lma 0x22b64
Loading section .jcr, size 0x4 lma 0x22b68
Loading section .data, size 0x9d8 lma 0x22b70
Start address 0x8130
Transfer rate: 371176 bits in <1 sec.
(gdb) run
Starting program:
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/outputs/gdb.base/dbx/dbx 

Breakpoint 1, main () at
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/../../../gdb/testsuite/gdb.base/average.c:25
25          int first = 0, last = 0;    /* stop-in-main */
(gdb) assign first=1
(gdb) print first
$1 = 1
(gdb) whereis my_list
All variables matching regular expression "my_list":

File
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/../../../gdb/testsuite/gdb.base/average.c:
static int my_list[10];
(gdb) file average.c:1
1       /* This is a sample program for the HP WDB debugger. */
2       
3       #include <stdio.h>
4       #include <stdlib.h>
5       
6       extern int sum(int *, int, int);
7       
8       #define num   10
9       
10      static int my_list[num] = {3,4,2,0,2,1,8,3,6,7};
(gdb) cont
Continuing.

Breakpoint 2, main () at
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/../../../gdb/testsuite/gdb.base/average.c:30
30          print_average (my_list, first, last - 3); /* stop-at-call */
(gdb) step
print_average (list=0x22b74 <my_list>, low=0, high=6) at
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/../../../gdb/testsuite/gdb.base/average.c:14
14              int total = 0, num_elements = 0, average = 0;
(gdb) func sum
'sum' not within current stack frame.
(gdb) stop in sum
Breakpoint 3 at 0x833c: file
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/../../../gdb/testsuite/gdb.base/sum.c,
line 6.
(gdb) cont
Continuing.

Breakpoint 3, sum (list=0x22b74 <my_list>, low=0, high=6) at
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/../../../gdb/testsuite/gdb.base/sum.c:6
6               int i = 0, s = 0;       /* stop-in-sum */
(gdb) func print_average
#1  0x00008284 in print_average (list=0x22b74 <my_list>, low=0, high=6) at
/home/aion1223/workspace/srcs/gdb_arm/build/gdb/testsuite/../../../gdb/testsuite/gdb.base/average.c:15
15              total = sum(list, low, high);


I believe that the output is as expected. In other words, GDB on and for x86
passes this test case, and the output above seems the same. I am not sure if
this bug is reproducible.

-- 
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]