On 06 Aug 2006, at 13:58, Frank Heckenbach wrote:
On a high-level it's not a problem. But you started this thread with gdb access which is a low-level issue. The advantage of formats without "strange" memory layout is that they're also agnostic of element sizes used (the original problem). But of course, that's not an absolute requirement. In fact, I'd prefer if there's a way to tell gdb about the element size (and bit/byte/word endianness and alignment), so different formats can be tried and used without worrying whether gdb suports them.
Maybe that is possible to a certain extent with the M2 record-set trick... At least you can order the bytes in any way you like using that.
I am indeed. These sort of issues can waste a lot of programmer time when going from one platform to another, which could be spent on much more useful things.
As you explained that FPC itself need this, I understand your concern. ;-) (It might be one of the biggest users of sets in binary files, otherwise I haven't seen many programs that do.)
I've at least already seen some others on the macpascal list.
However, as you said, you need some conversions anyway, does it make a big difference which kind of conversions (bit, byte, word reversing), once you have generic routines for these (which is a small one-time effort, of course).
There are two different things:
a) since we implement the compiler, it's obviously no problem to also implement and use the necessary helpers. Additionally, all our set reading and writing goes through two single routines, so it's easy to do this in the compiler. However, for end users it will be less obvious what's needed and they may have a lot more separate reads/ writes scattered throughout their sources (which may have to be updated again after they already did so previously). b) case a) is only about different byte/bit order. If in addition also the size of the set varies depending on the architecture, you open a whole new can of worms (because you have to start manually padding either on disk or in memory, and/or somehow calculate what the size of the set would be on another architecture).
Jonas