Bug 8400 - abort() in h8300 simulator:
Summary: abort() in h8300 simulator:
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: sim (show other bugs)
Version: 5.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-23 07:28 UTC by uros
Modified: 2015-11-22 08:06 UTC (History)
2 users (show)

See Also:
Host:
Target: h8300-*
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description uros 2003-07-23 07:28:00 UTC
[Converted from Gnats 1295]

in gdb/config/h8300/tm-h8300.h, NUM_REGS is #defined to 14, and gdbsim_fetch_register() calls sim_fetch register() functions with values from 0 .. 13.

In sim/h8300/compile.c, around line 1998, we have:
if (!h8300smode && rn >=EXR_REGNUM)
  rn++;

which now increases rn from 13 to 14. And because there is no register witn index 14, abort() in sim_fetc_register() is triggered.

Release:
gdb-5.3
Comment 1 uros 2003-07-23 07:28:00 UTC
Fix:
change "abort();" in sim/h8300/compile.c, function sim_fetch_register(), line 2003 to "return 0;"
(Perhaps also the abort() in sim_store_register() should be changed to "return 0;" ?)
Comment 2 Mike Frysinger 2015-11-22 08:06:03 UTC
this was fixed in commit dc5c3759e035d47d00088e43ea5871ffe717eb02 to issue a warning and return 0 instead of calling abort

https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=dc5c3759e035d47d00088e43ea5871ffe717eb02