Thank you for a *much* better analysis of the problem. (I checked a few sites and you missed a case where cfi.c is broken if you remove the warning, i.e. no error/warning is logged if you run out of working area, but otherwise a very productive post)
> I'm still convinced that the warning in target_alloc_working_area() >is misplaced. With the current situation, a bunch of warning may > be issued, but the software runs perfectly. I suggest that you create a new fn target_alloc_working_area_no_error() and invoke that for the "try" code and use LOG_ERROR() in target_alloc_working_area() . You can then delete all the superfluous LOG_ERROR() statements in code today that invokes target_alloc_working_area(). Like exceptions, the calling code can either pass up the exception, default case or catch(here the _no_error() is our equivalent) and handle the error. Like exceptions it's possible to catch an exception and ammend context information if necessary, most of the time just passing up an "out of working space" will be more than sufficient. (don't mention malloc() in this context, because we have swept all that error handling under the carpet for small allocations, here C++ exceptions would have made the code robust...) -- Øyvind Harboe Embedded software and hardware consulting services http://www.zylin.com _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development