0

So far, I have riscv-gcc/riscv-gdb available in command line, and a standard ddd for gui.

When I trying to follow ddd's manual and use --debugger option as:

ddd --debugger riscv32-unknown-elf-gdb

The ddd can show up the window, but it says "opening session 'blablabla'" at the left bottom coner.

And seems the ddd doesnt response.

So I would like to ask,

it is possible to use ddd for riscv-dbg?

If yes, then how?

any successful solution there?

Thanks. /Patrick

VoiceOfUnreason
  • 52,766
  • 5
  • 49
  • 91
Patrick
  • 31
  • 4

1 Answers1

1

I would say that it should work, but this may not work on your specific combination of Operating System/DDD - It worked for me using ubuntu 18.04.02 x86_64, ddd 3.3.12, and a riscv64 toolchain/GDB - Since DDD is a GUI front-end, targeting riscv32 or riscv64 should not matter.

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:        18.04

sudo apt-get install ddd
ddd --version
GNU DDD 3.3.12 (x86_64-pc-linux-gnu)                                                                                                                                                                                                          
Copyright (C) 1995-1999 Technische Universit�t Braunschweig, Germany.                                                                                                                                                                         
Copyright (C) 1999-2001 Universit�t Passau, Germany.                                                                                                                                                                                          
Copyright (C) 2001 Universit�t des Saarlandes, Germany.                                                                                                                                                                                       
Copyright (C) 2001-2009 Free Software Foundation, Inc.

I used the example code provided in the answer to this question, and qemu.

starting ddd - assuming here riscv64-unknown-elf-gdb is in your path:

ddd --debugger riscv64-unknown-elf-gdb

enter image description here

opening executable (add.elf in my case): File/Open Program

enter image description here

Connecting to target in ddd windows containing the (gdb) prompt: target remote localhost:1234

enter image description here

enter image description here

I hope this will help identifying what may be the issue in your case.

Frant
  • 5,382
  • 1
  • 16
  • 22
  • Thanks a lot for your comments! I'm using Ubuntu 16 with the latest DDD (default apt-get installed one, I guess it's the latest one). OK I will try to solve this issue. I saw you commented a lot of RV-related issues. That helps a lot for us. Thank you. If any issue I will com back again. – Patrick Mar 19 '19 at 00:50
  • By the way, the rv-dbg is a specific version since we only implemented rv32im in our hardware, so we use github/riscv-tool-chains, and build all submodules with only rv32im support. But all other options are not hacked. Maybe DDD version matters in this case, let me check it... – Patrick Mar 19 '19 at 00:55
  • BTWx2, we added some customized opcode into hardware, and also added them into RV-GCC (intrinsic asm), I'm not sure if that also change rv-dbg automatically. Since the newly added opcodes work on a new registerfile, if rv-dbg also be affected, the behavior of these opcodes in rv-dbg shouldn't be correct (we didn't update anything specifically for rv-dbg). here is also an issue maybe matter in this case. – Patrick Mar 19 '19 at 01:00
  • @Patrick You could test your DDD with the x86_64 GDB that available on your Ununtu 16.04: this may tell you if it is functional or not. – Frant Mar 19 '19 at 02:47
  • @Patrick Latest version of DDD is 3.3.12 - just run ddd --version on your system. – Frant Mar 19 '19 at 02:49
  • @Patrick I installed a Ubuntu 16.04, and DDD 3.3.12 is not working with the GDB for x86_64. Thus my answer is : it works, but may be not with the version that comes with 16.04. You could test with a live Ubuntu 18.04 Virtual Box machine and would get a confirmation within minutes that it is working fine on 18.04. – Frant Mar 20 '19 at 00:58
  • Thanks a lot Frant!! Recently I'm writing a debugger in python, since we have some customized opcodes, hacking gnu dbg is too difficult for us right now. I will try the tools in Ubuntu 18, since we need a golden ref for the legacy opcodes. Your research saves us a lot. I will keep updating this thread and make it as a reference for others untill our tool chain is ready. Thank you. – Patrick Mar 21 '19 at 05:29
  • @Patrick: You are welcome. By the way, if/when you are pleased with the answer, you may want to accept it. – Frant Mar 21 '19 at 18:07
  • OK, I will try ubuntu 18 this weekend, and provide a summary, and will accept it. Thanks! – Patrick Mar 22 '19 at 00:22