Dear Joakim Tjernlund, In message <ofee7adeea.47556dd1-onc12577f1.006faf8d-c12577f1.0071c...@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 -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de In a survey taken several years ago, all incoming freshmen at MIT were asked if they expected to graduate in the top half of their class. Ninety-seven percent responded that they did. _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot