<div dir="ltr"><div>So I cloned the 'sis' repository and build it locally:</div><div>$  git clone git://<a href="http://git.rtems.org/sis.git" target="_blank">git.rtems.org/sis.git</a></div><div>.</div><div>.</div><div>On one terminal I was running sis:</div><div>$ ~/development/sis/sis -riscv nouartrx -gdb</div><div>.</div><div>.</div><div>.</div><div>.<br></div><div>On another terminal I did:</div><div>$ riscv-rtems5-gdb psxfenv01.exe</div><div><br></div><div>Reading symbols from psxfenv01.exe...done.<br>(gdb) target extended-remote localhost:1234<br>Remote debugging using localhost:1234<br>0x00000000 in ?? ()<br>(gdb) load<br>Loading section .start, size 0x3c lma 0x80000000<br>Loading section .text, size 0xd8c4 lma 0x8000003c<br>Loading section .rodata, size 0x11e29 lma 0x8000d900<br>Loading section .sdata2, size 0x20 lma 0x8001f72c<br>Loading section .eh_frame, size 0x68 lma 0x8001f74c<br>Loading section .init_array, size 0x4 lma 0x8001f7b4<br>Loading section .fini_array, size 0x4 lma 0x8001f7b8<br>Loading section .rtemsroset, size 0x34 lma 0x8001f7bc<br>Loading section .data, size 0x488 lma 0x8001f7f0<br>Loading section .htif, size 0x1000 lma 0x8001fc80<br>Loading section .sdata, size 0x3c lma 0x80021000<br>Start address 0x80000000, load size 134321<br>Transfer rate: 2474 KB/sec, 236 bytes/write.<br>(gdb) run<br>The program being debugged has been started already.<br>Start it from the beginning? (y or n) y<br>Starting program: /home/varodek/development/rtems/kernel/rv32imac/riscv-rtems5/c/rv32imac/testsuites/psxtests/psxfenv01.exe <br></div><div>.</div><div>.</div><div>The screen just hangs here.</div><div><br></div><div>Vaibhav Gupta<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 14, 2019 at 12:48 PM Jiri Gaisler <<a href="mailto:jiri@gaisler.se" target="_blank">jiri@gaisler.se</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    <pre class="gmail-m_4458072827008294302gmail-m_-3538436456761226652moz-quote-pre">I have attached the sis manual. Page 17:

"SIS can be connected to gdb through a network socket using the gdb remote interface.
Either start SIS with -gdb, or issue the ’gdb’ command inside SIS, and connect gdb with
’target extended-remote localhost:1234’. The port can be changed using the -port option."

You still need all other options, so to start on a windows host do:

$ riscv-rtems-sis -riscv -nouartrx -gdb

To start gdb, do:

$ riscv-rtems-gdb app.exe

(gdb) target extended-remote localhost:1234

(gdb) load

(gdb) run

To re-run the application, issue a new load command first.

Regards, Jiri.
</pre>
    <div class="gmail-m_4458072827008294302gmail-m_-3538436456761226652moz-cite-prefix">On 8/14/19 12:37 AM, Vaibhav Gupta
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div dir="ltr"><br>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Wed, Aug 14, 2019 at 4:04
            AM Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>> wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <div dir="ltr">
              <div dir="ltr"><br>
              </div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">On Tue, Aug 13, 2019
                  at 5:09 PM Vaibhav Gupta <<a href="mailto:vaibhavgupta40@gmail.com" target="_blank">vaibhavgupta40@gmail.com</a>>
                  wrote:<br>
                </div>
                <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                  <div dir="ltr">
                    <div dir="ltr"><br>
                    </div>
                    <br>
                    <div class="gmail_quote">
                      <div dir="ltr" class="gmail_attr">On Mon, Aug 12,
                        2019 at 11:50 PM Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>>
                        wrote:<br>
                      </div>
                      <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                        <div dir="ltr">
                          <div>Can you post or email me privately the
                            full patch? I can try to see what I spot.</div>
                        </div>
                      </blockquote>
                      <div>I have sent you the patch. <br>
                      </div>
                      <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                        <div dir="ltr">
                          <div><br>
                          </div>
                          <div>Can you check with objdump or gdb that
                            the methods which don't appear to work </div>
                          <div>are actually the RISC-V implementation?
                            Look at the disassembly and see if it</div>
                          <div>looks like you expect.</div>
                        </div>
                      </blockquote>
                      <div>I am exploring for this.</div>
                    </div>
                  </div>
                </blockquote>
                <div><br>
                </div>
                <div>Since I don't know how to attach gdb to the new sis
                  for griscv, I emailed Jiri privately.</div>
                <div>Your program works as expected on Linux. Perhaps
                  Jiri has some advice for my</div>
                <div>debugging setup ignorance and fenv on RISC-V.</div>
              </div>
            </div>
          </blockquote>
          <div>Okay, I will wait. Till then I can work with porting for
            other architecture. :) <br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <div dir="ltr">
              <div class="gmail_quote">
                <div><br>
                </div>
                <div>Do you happen to have fenv support for another
                  architecture queued up? It would be</div>
                <div>interesting to see if it works on other targets.</div>
              </div>
            </div>
          </blockquote>
          <div>Yup, they were in my to do list. Till testsuite method is
            solved, I will work on them now.</div>
          <div><br>
          </div>
          <div>- Vaibhav Gupta<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <div dir="ltr">
              <div class="gmail_quote">
                <div><br>
                </div>
                <div>--joel</div>
                <div> </div>
                <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                  <div dir="ltr">
                    <div class="gmail_quote">
                      <div><br>
                      </div>
                      <div>- Vaibhav Gupta<br>
                      </div>
                      <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                        <div dir="ltr">
                          <div><br>
                          </div>
                          <div>Does this require a patch to newlib as
                            well?</div>
                          <div><br>
                          </div>
                          <div>--joel</div>
                          <br>
                          <div class="gmail_quote">
                            <div dir="ltr" class="gmail_attr">On Sun,
                              Aug 11, 2019 at 10:49 AM Vaibhav Gupta
                              <<a href="mailto:vaibhavgupta40@gmail.com" target="_blank">vaibhavgupta40@gmail.com</a>>
                              wrote:<br>
                            </div>
                            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                              <div dir="ltr">
                                <div>Configure command I used to build
                                  BSP:</div>
                                <div>
                                  <div>==============================================</div>
                                </div>
                                <div>$
                                  /home/varodek/development/rtems/kernel/rtems/configure
--prefix=/home/varodek/development/rtems/5 --enable-maintainer-mode
                                  --target=riscv-rtems5
                                  --enable-rtemsbsp=rv32imac
                                  --enable-tests --enable-posix
                                  --disable-networking --enable-cxx
                                  RISCV_ENABLE_HTIF_SUPPORT=1</div>
                                <div>
                                  <div>==============================================</div>
                                  <div>.<br>
                                  </div>
                                  <div>.</div>
                                  <div>.</div>
                                  <div>.</div>
                                  <div>Qemu command I used to run test:</div>
                                  <div>
                                    <div>==============================================</div>
                                    <div>$ qemu-system-riscv32
                                      -no-reboot -nographic -machine
                                      virt -m 256M -kernel psxfenv01.exe</div>
                                    <div>
                                      <div>==============================================</div>
                                      <div>
                                        <div>.<br>
                                        </div>
                                        <div>.</div>
                                        <div>.</div>
                                        <div>.</div>
                                        <div>Makefile.am</div>
                                        <div>
                                          <div>==============================================</div>
                                          <div>+ if TEST_psxfenv01<br>
                                            + psx_tests += psxfenv01<br>
                                            + psxfenv01_SOURCES =
                                            psxfenv01/init.c<br>
                                            + psxfenv01_CPPFLAGS =
                                            $(AM_CPPFLAGS)
                                            $(TEST_FLAGS_psxfenv01) \<br>
                                            +       $(support_includes)<br>
                                            + psxfenv01_LDADD = -lm
                                            $(LDADD)<br>
                                            + endif</div>
                                          <div>+<br>
                                          </div>
                                          <div>
                                            <div>==============================================</div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                              <br>
                              <div class="gmail_quote">
                                <div dir="ltr" class="gmail_attr">On
                                  Sun, Aug 11, 2019 at 8:36 PM Vaibhav
                                  Gupta <<a href="mailto:vaibhavgupta40@gmail.com" target="_blank">vaibhavgupta40@gmail.com</a>>
                                  wrote:<br>
                                </div>
                                <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                                  <div dir="ltr">
                                    <div>My code of testsuite:</div>
                                    <div>===============================================<br>
                                    </div>
                                    <div>  /* Test 'FE_DIVBYZERO' */<br>
                                        puts( "\nDivide by zero and
                                      confirm fetestexcept()." );<br>
                                        a = 0.0;<br>
                                        b = 1.0;<br>
                                        c = b/a;<br>
                                        printf("\n%d",FE_DIVBYZERO);<br>
                                       
                                      fegetexceptflag(&excepts,FE_ALL_EXCEPT);<br>
                                        printf("\n%d",excepts);<br>
                                        r = feraiseexcept(FE_DIVBYZERO);<br>
                                        printf("\n%d\n",r);<br>
                                        rtems_test_assert( fetestexcept(
                                      FE_DIVBYZERO ) );</div>
                                    <div>==============================================</div>
                                    <div>OUTPUT</div>
                                    <div>==============================================</div>
                                    <div>Divide by zero and confirm
                                      fetestexcept().<br>
                                      <br>
                                      8<br>
                                      0<br>
                                      1<br>
/home/varodek/development/rtems/kernel/rtems/c/src/../../testsuites/psxtests/psxfenv01/init.c:
                                      84 fetestexcept( FE_DIVBYZERO )<br>
                                    </div>
                                    <div>
                                      <div>==============================================</div>
                                      <div>EXPECTED OUTPUT</div>
                                      <div>
                                        <div>==============================================</div>
                                        <div>Divide by zero and confirm
                                          fetestexcept().<br>
                                          <br>
                                          8<br>
                                          8<br>
                                          0<br>
                                        </div>
                                        <div>
                                          <div>==============================================</div>
                                        </div>
                                      </div>
                                      <div>- fetestexcept( FE_DIVBYZERO
                                        ), should return a non-zero
                                        value as division-by-zero was
                                        performed.</div>
                                      <div>.</div>
                                      <div>-
                                        feraiseexcept(FE_DIVBYZERO); is
                                        also not working. It should
                                        return zero when successful</div>
                                      <div>.</div>
                                      <div>==============================================</div>
                                      <div><br>
                                      </div>
                                      <div>Thank You</div>
                                      <div>Vaibhav Gupta<br>
                                      </div>
                                      <div><br>
                                      </div>
                                    </div>
                                  </div>
                                </blockquote>
                              </div>
_______________________________________________<br>
                              devel mailing list<br>
                              <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
                              <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote>
                          </div>
                        </div>
                      </blockquote>
                    </div>
                  </div>
                </blockquote>
              </div>
            </div>
          </blockquote>
        </div>
      </div>
      <br>
      <fieldset class="gmail-m_4458072827008294302gmail-m_-3538436456761226652mimeAttachmentHeader"></fieldset>
      <pre class="gmail-m_4458072827008294302gmail-m_-3538436456761226652moz-quote-pre">_______________________________________________
devel mailing list
<a class="gmail-m_4458072827008294302gmail-m_-3538436456761226652moz-txt-link-abbreviated" href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a>
<a class="gmail-m_4458072827008294302gmail-m_-3538436456761226652moz-txt-link-freetext" href="http://lists.rtems.org/mailman/listinfo/devel" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></pre>
    </blockquote>
  </div>

</blockquote></div>