LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-29-2017, 02:42 AM   #1
riscv
Member
 
Registered: Mar 2017
Posts: 34

Rep: Reputation: Disabled
Smile 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 !
 
Old 03-29-2017, 07:22 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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.
 
Old 03-29-2017, 02:50 PM   #3
riscv
Member
 
Registered: Mar 2017
Posts: 34

Original Poster
Rep: Reputation: Disabled
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 !
 
Old 03-29-2017, 02:59 PM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
You have to rebuild the code.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gdb, debug with separate debug file and different source dir problem a4z Programming 5 10-17-2014 01:55 AM
debug kernel with gdb bestyharis Linux - Newbie 3 11-02-2011 05:41 PM
how to debug macros under gdb dayalan_cse Programming 7 06-29-2010 09:24 AM
cannot debug with gdb ufmale Programming 9 04-27-2009 05:21 PM
how to debug multithread using GDB? ryanux Programming 1 05-11-2004 12:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration