This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] RISC-V: Don't decrement pc after break.
- From: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- To: Jim Wilson <jimw at sifive dot com>, gdb-patches at sourceware dot org
- Cc: andrew dot burgess at embecosm dot com
- Date: Mon, 23 Jul 2018 12:30:59 +0200
- Subject: Re: [PATCH] RISC-V: Don't decrement pc after break.
- References: <20180717001241.25908-1-jimw@sifive.com>
Hello Jim,
this patch broke debugging with Qemu (qemu-system-riscv64, Git commit
6598f0cdad6acc6674c4f060fa46e537228c2c47). The GDB error message is:
Register 3921 is not available
A backtrace of the GDB run with a break point set the throw_error() yields:
Breakpoint 1, throw_error (error=error@entry=NOT_AVAILABLE_ERROR,
fmt=fmt@entry=0x87b0c0 "Register %d is not available") at
/home/EB/sebastian_h/archive/binutils-git/gdb/common/common-exceptions.c:390
390 {
Missing separate debuginfos, use: zypper install
libexpat1-debuginfo-2.1.0-24.1.x86_64
libgmp10-debuginfo-5.1.3-7.15.x86_64
libmpfr4-debuginfo-3.1.2-13.15.x86_64
libncurses5-debuginfo-5.9-62.1.x86_64
libpython2_7-1_0-debuginfo-2.7.13-27.3.1.x86_64
python-base-debuginfo-2.7.13-27.3.1.x86_64
(gdb) bt
#0 throw_error (error=error@entry=NOT_AVAILABLE_ERROR,
fmt=fmt@entry=0x87b0c0 "Register %d is not available") at
/home/EB/sebastian_h/archive/binutils-git/gdb/common/common-exceptions.c:390
#1 0x0000000000578552 in frame_unwind_register_unsigned
(next_frame=<optimized out>, regnum=regnum@entry=834) at
/home/EB/sebastian_h/archive/binutils-git/gdb/frame.c:1308
#2 0x000000000057857c in get_frame_register_unsigned
(frame=frame@entry=0xb933c0, regnum=regnum@entry=834) at
/home/EB/sebastian_h/archive/binutils-git/gdb/frame.c:1322
#3 0x0000000000413d7d in riscv_read_misa_reg (read_p=<synthetic
pointer>) at /home/EB/sebastian_h/archive/binutils-git/gdb/riscv-tdep.c:306
#4 riscv_has_feature (gdbarch=0xc50cc0, feature=<optimized out>) at
/home/EB/sebastian_h/archive/binutils-git/gdb/riscv-tdep.c:338
#5 0x00000000004149de in riscv_breakpoint_kind_from_pc
(gdbarch=<optimized out>, pcptr=<optimized out>) at
/home/EB/sebastian_h/archive/binutils-git/gdb/riscv-tdep.c:416
#6 0x00000000004b3ef1 in default_breakpoint_from_pc (gdbarch=0xc50cc0,
pcptr=<optimized out>, lenptr=0x7fffffffd014) at
/home/EB/sebastian_h/archive/binutils-git/gdb/arch-utils.c:833
#7 0x00000000004ccbb1 in program_breakpoint_here_p (gdbarch=<optimized
out>, address=2147498700) at
/home/EB/sebastian_h/archive/binutils-git/gdb/breakpoint.c:8656
#8 0x00000000004ccdb6 in bp_loc_is_permanent (loc=0xd982a0) at
/home/EB/sebastian_h/archive/binutils-git/gdb/breakpoint.c:8694
#9 add_location_to_breakpoint (b=b@entry=0xd7b5f0,
sal=sal@entry=0x7fffffffd0f0) at
/home/EB/sebastian_h/archive/binutils-git/gdb/breakpoint.c:8638
#10 0x00000000004cceab in init_raw_breakpoint (b=0xd7b5f0,
gdbarch=<optimized out>, sal=..., bptype=bp_breakpoint, ops=<optimized
out>) at /home/EB/sebastian_h/archive/binutils-git/gdb/breakpoint.c:7200
#11 0x00000000004d0fa8 in init_breakpoint_sal (b=0xd7b5f0,
gdbarch=0xc50cc0, sals=..., location=..., filter=..., cond_string=...,
extra_string=..., type=bp_breakpoint, disposition=disp_donttouch,
thread=-1, task=0, ignore_count=0, ops=0xa555e0 <bkpt_breakpoint_ops>,
from_tty=0, enabled=1, flags=0, display_canonical=0,
internal=<optimized out>) at
/home/EB/sebastian_h/archive/binutils-git/gdb/breakpoint.c:8828
#12 0x00000000004d7b12 in create_breakpoint_sal
(display_canonical=<optimized out>, flags=<optimized out>,
internal=<optimized out>, enabled=<optimized out>, from_tty=<optimized
out>, ops=<optimized out>, ignore_count=<optimized out>, task=<optimized
out>,
thread=<optimized out>, disposition=<optimized out>,
type=<optimized out>, extra_string=..., cond_string=..., filter=...,
location=..., sals=..., gdbarch=<optimized out>) at
/home/EB/sebastian_h/archive/binutils-git/gdb/breakpoint.c:8932
#13 create_breakpoints_sal (flags=<optimized out>, internal=<optimized
out>, enabled=<optimized out>, from_tty=<optimized out>, ops=<optimized
out>, ignore_count=<optimized out>, task=<optimized out>,
thread=<optimized out>, disposition=<optimized out>,
type=<optimized out>, extra_string=..., cond_string=...,
canonical=0x7fffffffd3c0, gdbarch=<optimized out>) at
/home/EB/sebastian_h/archive/binutils-git/gdb/breakpoint.c:8984
#14 create_breakpoints_sal_default (flags=<optimized out>,
internal=<optimized out>, enabled=<optimized out>, from_tty=<optimized
out>, ops=<optimized out>, ignore_count=<optimized out>, task=<optimized
out>, thread=<optimized out>, disposition=<optimized out>,
type_wanted=<optimized out>, extra_string=..., cond_string=...,
canonical=0x7fffffffd3c0, gdbarch=<optimized out>) at
/home/EB/sebastian_h/archive/binutils-git/gdb/breakpoint.c:13806
#15 bkpt_create_breakpoints_sal (gdbarch=<optimized out>,
canonical=0x7fffffffd3c0, cond_string=..., extra_string=...,
type_wanted=<optimized out>, disposition=<optimized out>,
thread=<optimized out>, task=<optimized out>, ignore_count=<optimized out>,
ops=<optimized out>, from_tty=<optimized out>, enabled=<optimized
out>, internal=<optimized out>, flags=<optimized out>) at
/home/EB/sebastian_h/archive/binutils-git/gdb/breakpoint.c:12608
#16 0x00000000004d8454 in create_breakpoint (gdbarch=0xc50cc0,
location=location@entry=0xc76770, cond_string=cond_string@entry=0x0,
thread=<optimized out>, thread@entry=0, extra_string=<optimized out>,
extra_string@entry=0xc70bcb "", parse_extra=parse_extra@entry=1,
tempflag=<optimized out>, type_wanted=<optimized out>,
ignore_count=<optimized out>, pending_break_support=<optimized out>,
ops=<optimized out>, from_tty=<optimized out>, enabled=<optimized out>,
internal=<optimized out>, flags=<optimized out>)
at /home/EB/sebastian_h/archive/binutils-git/gdb/breakpoint.c:9357
#17 0x00000000004d8901 in break_command_1 (arg=<optimized out>,
flag=<optimized out>, from_tty=0) at
/home/EB/sebastian_h/archive/binutils-git/gdb/breakpoint.c:9436
#18 0x00000000006bc292 in cmd_func (cmd=<optimized out>, args=<optimized
out>, from_tty=<optimized out>) at
/home/EB/sebastian_h/archive/binutils-git/gdb/cli/cli-decode.c:1857
#19 0x000000000067ae6e in execute_command (p=<optimized out>,
p@entry=0xc70bc0 "b bsp_reset", from_tty=0) at
/home/EB/sebastian_h/archive/binutils-git/gdb/top.c:630
#20 0x000000000056b26c in command_handler (command=0xc70bc0 "b
bsp_reset") at /home/EB/sebastian_h/archive/binutils-git/gdb/event-top.c:583
#21 0x000000000067b981 in read_command_file
(stream=stream@entry=0xc70960) at
/home/EB/sebastian_h/archive/binutils-git/gdb/top.c:424
#22 0x00000000006bffae in script_from_file
(stream=stream@entry=0xc70960, file=file@entry=0x7fffffffde4a
"~/bin/riscv.gdb") at
/home/EB/sebastian_h/archive/binutils-git/gdb/cli/cli-script.c:1551
#23 0x00000000006b9feb in source_script_from_stream
(file_to_open=0x7fffffffde4a "~/bin/riscv.gdb", file=0x7fffffffde4a
"~/bin/riscv.gdb", stream=0xc70960) at
/home/EB/sebastian_h/archive/binutils-git/gdb/cli/cli-cmds.c:567
#24 source_script_with_search (file=0x7fffffffde4a "~/bin/riscv.gdb",
from_tty=<optimized out>, search_path=<optimized out>) at
/home/EB/sebastian_h/archive/binutils-git/gdb/cli/cli-cmds.c:603
#25 0x00000000005c6a18 in catch_command_errors (command=0x6ba0d0
<source_script(char const*, int)>, arg=0x7fffffffde4a "~/bin/riscv.gdb",
from_tty=1) at /home/EB/sebastian_h/archive/binutils-git/gdb/main.c:379
#26 0x00000000005c76c1 in captured_main_1 (context=0x7fffffffd6e0) at
/home/EB/sebastian_h/archive/binutils-git/gdb/main.c:1121
#27 captured_main (data=0x7fffffffd6e0) at
/home/EB/sebastian_h/archive/binutils-git/gdb/main.c:1147
#28 gdb_main (args=args@entry=0x7fffffffd810) at
/home/EB/sebastian_h/archive/binutils-git/gdb/main.c:1173
#29 0x000000000040dba5 in main (argc=<optimized out>, argv=<optimized
out>) at /home/EB/sebastian_h/archive/binutils-git/gdb/gdb.c:32
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber@embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.