
Dear Joakim Tjernlund,
In message OFEE7ADEEA.47556DD1-ONC12577F1.006FAF8D-C12577F1.0071C097@transmode.se you wrote:
This is indeed much uglier. What exactly is your problem with debugging the existing code?
Whenever I screw up so that one of the init funcs crashes, often without any trace on the RS232 port you don't know which one. Single stepping
Well, we turn on the serial ports as early as possible, so ther eis only a pretty small collection that is candidate for such a situation.
though the loop is cumbersome and not easy as BDI tends to flush the cache when it stops so you loose your stack.
Does it? On which architecture / processor is this?
The other way is to look up one those funs and set a BP there and hope for the best. Then repeat with the next function and so on. Compare that with just setting a BP in the new init_sequence(), it is fast and easy to move around.
...but ugly to read. And if you really want to introduce this style, it has to be done for all architectures, as I want to see this code to become common across architectures.
I don't think you have been chasing bugs in this area for a long time, if you had, you would appreciate how easy it is with functions compared with a bunch of function ptrs.
I haven't, lately, that's true, or when I had, I always knew pretty well where I had to expect the issues. But I've been there before, many, many times.
I don't think this is much uglier, just a bit, but far more useful and I have a hard time buying into "beautiful trumps usefulness".
I'm not convinced that your code is actually a general improvement. I understand that it's useful for you, and your style of debugging. If you are really hanging in this area, then maybe a debug() is more prowerfull - and less invasive.
Best regards,
Wolfgang Denk