> > Hi Andrew, > > The problem with calling __builtin_trap directly comes when several > traps are called in the same function. For example, if a function > contains several identical assertions on different code paths, then gcc > will generate a single copy of the assertion, and branch to that copy > from each of the original assertion sites. If an assertion is hit, it > becomes impossible to tell which of the original source assertions this > relates to. Note that this is an embedded processor, so the source line, > error description and so on can't be embedded in the assertion, since > that consumes too much space; all an assertion does is test the > condition, and possibly call the HALT.
Well the easy way around this is have a function which just does halt but sends the line number before halting. I don't see anyway around this really except taking up more space. -- Pinski