From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Kevin Buettner Cc: gdb@sources.redhat.com Subject: Re: How to add core addresses (or LM_ADDR problems revisited) Date: Wed, 03 Oct 2001 08:50:00 -0000 Message-id: <3BBB33A6.3000706@cygnus.com> References: <1011003013114.ZM22147@ocotillo.lan> <3BBA7ED7.50205@cygnus.com> <1011003080243.ZM22427@ocotillo.lan> X-SW-Source: 2001-10/msg00044.html > Second, regarding the types, I (initially) also thought that an offset > should be represented as some other type (than a CORE_ADDR), but in > the process of converting existing GDB code to use core_addr_add() and > core_addr_sub(), I've found that the type of the offset is almost > always a CORE_ADDR. (Maybe even always.) I suppose it's possible that > we simply have this detail wrong, but I'm reluctant to change it at > the moment. (It's rather pervasive...) Yes, I've noticed this. I still think the difference between two addresses is an offset, the addition of two addresses being pretty meaningless, and an address plus offset returns an address. If I were you, I wouldn't try to fix the actual code - it hasn't affected things so far so I don't see this change breaking anything. Instead, I'd just get the functions right and and add a note explaining the problem of incorrect use. Later, when someone tries to make a CORE_ADDR into a struct, this second problem can be fixed. enjoy, Andrew PS: DOUBLEST is in a similar situtation.