Bug 7504 - sim.h: sim_read & sim_write cannot handle 64 bit addresses
Summary: sim.h: sim_read & sim_write cannot handle 64 bit addresses
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: sim (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Mike Frysinger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-06 18:58 UTC by ac131313
Modified: 2022-12-23 01:05 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ac131313 2002-03-07 02:58:00 UTC
[Converted from Gnats 399]

remote-sim.h defines SIM_ADDR using:

/* Pick up CORE_ADDR_TYPE if defined (from gdb), otherwise use same value as
   gdb does (unsigned int - from defs.h).  */

#ifndef CORE_ADDR_TYPE
typedef unsigned int SIM_ADDR;
#else
typedef CORE_ADDR_TYPE SIM_ADDR;
#endif

The address isn't large enough (int is typically 32 bits) so doesn't hold 64 bit addresses.

Suggest looking at bfd.h or sim/common/sim-types.h.  The main thing is that this the remote-sim.h header can't depend on external configury (from defs.h or ...)

Release:
unknown
Comment 1 Mike Frysinger 2022-11-08 08:03:20 UTC
i wonder if we shouldn't change it to be 64-bit all the time

the "length" arguments should probably also be adjusted as they're "int" atm too
Comment 2 Tom Tromey 2022-11-08 14:23:48 UTC
(In reply to Mike Frysinger from comment #1)
> i wonder if we shouldn't change it to be 64-bit all the time

FWIW gdb switched CORE_ADDR to always be 64-bit a while ago.
Comment 3 Mike Frysinger 2022-11-11 18:49:18 UTC
ok, i'll change the address & length to 64-bit post GDB 13 release.  a 64-bit address with a 32-bit length would mean being able to access only 4GiB at a time, and we def have programs nowadays that take up more than 4GiB.
Comment 4 Mike Frysinger 2022-12-23 01:05:30 UTC
should be fixed in latest tree for gdb-14+