Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error to set pc? #3

Open
lx324310 opened this issue Apr 25, 2016 · 2 comments
Open

error to set pc? #3

lx324310 opened this issue Apr 25, 2016 · 2 comments

Comments

@lx324310
Copy link

HI:
when i connect advance debug with riscv gdb , I can download code and set pc and so on. but PC value can't set high bit as zero. the log as follow:
(gdb) set $pc=0x8c
(gdb) i a r
Ambiguous info command "a r": address, all-registers, args, auxv.
(gdb) info all-registers
zero 0x14800000000 1408749273088
ra 0x108000 1081344
fp 0x0 0
s1 0x0 0
s2 0x0 0
s3 0x0 0
s4 0x1a10700000000000 1878124189915807744
s5 0x1a10000000000002 1878001044613496834
s6 0x0 0
s7 0x0 0
s8 0x0 0
s9 0x0 0
l0 0x0 0
l1 0x10046000100464 4508409991791716
sp 0x0 0
tp 0x0 0
v0 0x8c 140
v1 0xffffffff00000000 -4294967296
a0 0xffffffff00000000 -4294967296
a1 0xffffffff00000000 -4294967296
a2 0xffffffff00000000 -4294967296
a3 0xffffffff00000000 -4294967296
a4 0xffffffff00000000 -4294967296
a5 0xffffffff00000000 -4294967296
a6 0xffffffff00000000 -4294967296
a7 0xffffffff00000000 -4294967296
t0 0xffffffff00100464 -4293917596
t1 0xffffffff00100460 -4293917600
t2 0xffffffff00000000 -4294967296
t3 0xffffffff00000000 -4294967296
t4 0xffffffff00000000 -4294967296
gp 0xffffffff00000000 -4294967296
pc 0xffffffff0000008c -4294967156
Could not fetch register "fs0"; remote failure reply 'E01'
How can i set the high bit of PC as zero?

@darius-bluespec
Copy link

This repository is no longer maintained and is the not the recommended version of gdb for RISC-V development. The newer, maintained version of gdb is here [https://github.com/riscv/riscv-binutils-gdb].

@lx324310
Copy link
Author

Thanks for your answer! I have try the RISC-V GDB tool from the git https://github.com/riscv/riscv-binutils-gdb
here is my steps to build it:
git clone https://github.com/riscv/riscv-binutils-gdb.git
cd riscv-binutils-gdb
mkdir build
cd build
../configure --target=riscv32-unknown-elf --prefix=/opt/riscv32gdb
make
make install
after doing this, I used gdb to connect with advance debug, the result as follows :

(gdb) target remote :1234
Remote debugging using :1234
(gdb) load
Loading section .vectors, size 0x8c lma 0x0
Loading section .text, size 0x220 lma 0x8c
Loading section .text.startup.main, size 0x4c lma 0x2ac
Loading section .text.illegal_insn_handler_c, size 0x2c lma 0x2f8
Loading section .text.qprinti.constprop.2, size 0x3e4 lma 0x324
Loading section .text.printf, size 0x7a0 lma 0x708
Loading section .text.puts, size 0x60 lma 0xea8
Loading section .text.set_pin_function, size 0x48 lma 0xf08
Loading section .text.set_gpio_pin_direction, size 0x68 lma 0xf50
Loading section .text.set_gpio_pin_value, size 0x68 lma 0xfb8
Loading section .text.int_time_cmp, size 0x4 lma 0x1020
Loading section .text.int_main, size 0x58 lma 0x1024
Loading section .text.uart_set_cfg, size 0x50 lma 0x107c
Loading section .text.uart_sendchar, size 0x1c lma 0x10cc
Loading section .text.uart_wait_tx_done, size 0x14 lma 0x10e8
Loading section .text.eoc, size 0x60 lma 0x10fc
Loading section .text.exit, size 0x10 lma 0x115c
Loading section .rodata, size 0x1b8 lma 0x100000
Loading section .eh_frame, size 0x190 lma 0x1001b8
Loading section .data, size 0x10 lma 0x100348
Loading section .sdata.setme, size 0x4 lma 0x100358
Loading section .sdata.setme2, size 0x4 lma 0x10035c
Start address 0x8c, load size 5324
Transfer rate: 1 KB/sec, 242 bytes/write.
(gdb) info registers
The current thread has terminated
(gdb)

I can load code to memory,but i can't use other gdb command,such as info,set $pc ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants