LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   DEBUG WITH GDB ERROR ! - spike: unrecognized option --gdb-port (https://www.linuxquestions.org/questions/linux-newbie-8/debug-with-gdb-error-spike-unrecognized-option-gdb-port-4175602760/)

riscv 03-29-2017 02:42 AM

DEBUG WITH GDB ERROR ! - spike: unrecognized option --gdb-port
 
Hello,

I've installed and built the riscv toolchain and i'm following these insructions:

Running spike --gdb-port 9824 pk tests/debug or spike --gdb-port 9824 pk debug/tests in the first terminal gives the following error:

Code:

spike: unrecognized option --gdb-port
usage: spike [host options] <target program> [target options]
Host Options:
  -p <n>            Simulate <n> processors
  -m <n>            Provide <n> MB of target memory
  -d                Interactive debug mode
  -g                Track histogram of PCs
  -h                Print this help message
  --ic=<S>:<W>:<B>  Instantiate a cache model with S sets,
  --dc=<S>:<W>:<B>    W ways, and B-byte blocks (with S and
  --l2=<S>:<W>:<B>    B both powers of 2).
  --extension=<name> Specify RoCC Extension
  --extlib=<name>    Shared library to load

Could you please tell me if i'm missing some element that i haven't installed or is the command i'm running wrong ?

Thank you !

rtmistler 03-29-2017 07:22 AM

Doesn't appear that you've compiled the exact source provided in that GitHub example. In spike_main/spike.cc shows as:
Code:

static void help()
{
  fprintf(stderr, "usage: spike [host options] <target program> [target options]\n");
  fprintf(stderr, "Host Options:\n");
  fprintf(stderr, "  -p<n>                Simulate <n> processors [default 1]\n");
  fprintf(stderr, "  -m<n>                Provide <n> MiB of target memory [default 4096]\n");
  fprintf(stderr, "  -d                    Interactive debug mode\n");
  fprintf(stderr, "  -g                    Track histogram of PCs\n");
  fprintf(stderr, "  -l                    Generate a log of execution\n");
  fprintf(stderr, "  -h                    Print this help message\n");
  fprintf(stderr, "  -H                Start halted, allowing a debugger to connect\n");
  fprintf(stderr, "  --isa=<name>          RISC-V ISA string [default %s]\n", DEFAULT_ISA);
  fprintf(stderr, "  --ic=<S>:<W>:<B>      Instantiate a cache model with S sets,\n");
  fprintf(stderr, "  --dc=<S>:<W>:<B>        W ways, and B-byte blocks (with S and\n");
  fprintf(stderr, "  --l2=<S>:<W>:<B>        B both powers of 2).\n");
  fprintf(stderr, "  --extension=<name>    Specify RoCC Extension\n");
  fprintf(stderr, "  --extlib=<name>      Shared library to load\n");
  fprintf(stderr, "  --gdb-port=<port>  Listen on <port> for gdb to connect\n");
  fprintf(stderr, "  --dump-config-string  Print platform configuration string and exit\n");
  exit(1);
}

Your option list shows differently, and not just cut off, but different where there is missing the capital -H, the --isa term, and then the --gdb-port as well as the --dump-config options are not at the end of your output.

Have you modified the original code provided in that Git repository?

That posting is dated 2011, but it may be worth attempting to contact the poster of it to see if they can provide more details about this problem; however my read is that you've cut out some code from their original offering and thus that error is not just within the help output, but also in the argument parsing for the main program.

riscv 03-29-2017 02:50 PM

Yes, in fact the spike.cc was different from the one on Github. I'm sorry if this sounds silly (newbie) but i've replaced the code in my spike.cc with the newer one. Does that mean i have to build everything ? or just configure riscv-isa-sim (/.configure) ?

Code:

alpha@alpha-VirtualBox:~/lowrisc-chip/riscv-tools/riscv-isa-sim$ ls
aclocal.m4      config.h.in  configure.ac  LICENSE      riscv    softfloat
autom4te.cache  config.log  dummy_rocc    Makefile.in  rvc      spike_main
build          configure    hwacha        README.md    scripts

Thank you !

rtmistler 03-29-2017 02:59 PM

You have to rebuild the code.


All times are GMT -5. The time now is 11:07 AM.