#2644 closed defect (fixed)

sis does not run on gdb 7.11 but does on gdb 7.9

Reported by: Joel Sherrill Owned by:
Priority: normal Milestone: 5.1
Component: tool/rsb Version: 5
Severity: normal Keywords:
Cc: Chris Johns Blocked By:
Blocking:

Description

I know we reported this on the gdb list but we should have a ticket.

Neither gdb nor run works for sis on gdb 4.11. Checked against RTEMS 4.11 tools (gdb 4.9) and it will run sis.

Not sure about other simulators.

Change History (9)

comment:1 Changed on 03/15/16 at 22:24:32 by Chris Johns

Summary: sis does not run on gdb 4.11 but does on gdb 4.9sis does not run on gdb 7.11 but does on gdb 7.9

There is 2 separate problems:

  1. the run command does not work any more
  2. on Linux and OS X the simulator does not work

This patch https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=465fb143 changed the sim/erc32 from the sim/common/run.c to sis.o for the run command so in effect made the run command the same as the sis command.

Our rtems-4.11 release uses gdb-7.9 with 23 patches (https://git.rtems.org/rtems-tools/tree/tools/4.11/gdb/sparc/7.9?h=4.11) so upgrading to gdb-7.11 was considered a better move than moving the rtems-4.11 patches to rtems-4.12. Of the 23 patches gdb-7.11 has patches 0001-0013 merged along with 0016 and the remaining patches are not merged. The 0014 patch is a gdb-7.9 version of my patch to clean up the output paths. Without that patch the erc32 does not support MI mode and can block on input locking up when run in the test framework. The remaining patches are LEON2 and LEON3 support which I am not sure about and watchpoints.

Running on FreeBSD works with the sparc/sis BSP. Running on Linux gives:

chris@titi:~/development/rtems/test/gdb/sparc-rtems4.12$ /opt/rtems/4.12/bin/sparc-rtems4.12-gdb /home/chris/development/rtems/kernel/erc32-sis/sparc-rtems4.12/c/sis/testsuites/samples/hello/hello.exe
GNU gdb (GDB) 7.11
Copyright (C) 2016 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=sparc-rtems4.12".
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 /home/chris/development/rtems/kernel/erc32-sis/sparc-rtems4.12/c/sis/testsuites/samples/hello/hello.exe...done.
(gdb) tar sim -v

 SIS - SPARC instruction simulator 2.7.5
 Bug-reports to Jiri Gaisler ESA/ESTEC (jgais@wd.estec.esa.nl)
RAM start: 0x2000000, RAM size: 256 K, ROM size: 128 K
Waitstates = RAM read: 3, RAM write: 3, ROM read: 15, ROM write: 15
Watchdog started, scaler = 255, counter = 65535
serial port A on stdin/stdout
Connected to the simulator.
(gdb) load
loading /home/chris/development/rtems/kernel/erc32-sis/sparc-rtems4.12/c/sis/testsuites/samples/hello/hello.exe:
section .text at 0x02000000 (0x19980 bytes)
section .rtemsroset at 0x02019980 (0x40 bytes)
section .data at 0x020199c0 (0x670 bytes)
section .bss at 0x0201a040 (0x1920 bytes)(not loaded)
(gdb) run
Starting program: /home/chris/development/rtems/kernel/erc32-sis/sparc-rtems4.12/c/sis/testsuites/samples/hello/hello.exe 
RAM start: 0x2000000, RAM size: 256 K, ROM size: 128 K
Waitstates = RAM read: 3, RAM write: 3, ROM read: 15, ROM write: 15
Watchdog started, scaler = 255, counter = 65535
resuming at 2000000
Waitstates = RAM read: 0, RAM write: 0, ROM read: 0, ROM write: 0
Watchdog disabled
Error manager halt - MEC hardware error
RAM start: 0x2000000, RAM size: 4096 K, ROM size: 1024 K
Error manager halt - IU in error mode
Error manager halt - MEC hardware error
[Inferior 1 (process 42000) exited normally]
(gdb) 

I am not sure what broken this.

Back to the run command. The run command should be using sim/common/nrun.c and this moves the simulator to the common structure and that conflicts with the sim/erc32/inferf.c code. The erc32 sim_open is broken and needs to be fixed to return a real SIM_DESC and that needs to be filled in correct. An issue I am not sure about is now the inferior's memory access routines link up with the SIS view of memory. I suspect they would be separate pieces of memory.

Also the sim/erc32 makes lots of printf calls and these needs to via GDB's filtered print calls. The direct printf calls break MI support.

comment:2 Changed on 03/16/16 at 04:51:02 by Chris Johns <chrisj@…>

In 0bbd2de7f5306ad15ce544f9c3e9a5d9bb00dc85/rtems-tools:

4.12: Patches for ERC simualtor for gdb-7.11.

The patches fix the endian checks in the simulator, print filtering,
and the run command.

Updates #2644.

comment:3 Changed on 03/16/16 at 04:55:11 by Chris Johns <chrisj@…>

In 08aa888205798b3416d24544fd06613fd683bb1e/rtems-source-builder:

4.12/gdb-7.11: Add ERC32 patches to fix the simulator.

Updates #2644.

comment:4 Changed on 03/16/16 at 14:48:04 by Joel Sherrill

sis command still does not work. Or I don't remember how to use it. :)

comment:5 Changed on 03/16/16 at 19:55:36 by Chris Johns

What is the sis command?

comment:6 Changed on 03/16/16 at 19:56:48 by Chris Johns

FYI I ran all the SIS and ERC32 tests in a single run. The results are:

Passed:   1062
Failed:      3
Timeouts:    3
Invalid:     0
--------------
Total:    1068

Failures:
 psxcancel.exe
 psxcancel.exe
 spcontext01.exe
Timeouts:
 crypt01.exe
 spcontext01.exe
 crypt01.exe
Average test time: 0:00:00.667911
Testing time     : 0:11:53.329500

comment:7 Changed on 11/14/16 at 16:34:00 by Joel Sherrill

Resolution: fixed
Status: newclosed

comment:8 Changed on 05/11/17 at 07:31:02 by Sebastian Huber

Milestone: 4.124.12.0

comment:9 Changed on 11/09/17 at 06:27:14 by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.