Re: [Openocd-development] [PATCH] debug message

2009-09-25 Thread Øyvind Harboe
Hi Rolf, please try to rewrite your patch using log_try/catch/rethrow that was just committed. The correct implementation for handling a loop that tries something is just like C++: while (!lasttime) { log_try(); // attempt something here lasttime = xxx; if (lasttime) log_r

Re: [Openocd-development] [PATCH] debug message

2009-09-18 Thread Øyvind Harboe
I've looked at this some more and I'm afraid we're going to have to implement the try+catch+rethrow mechanism. Not hard, I've got it mostly typed up. The problem is with e.g. trying one big codepath and then invoking another in the fallback case. -- Øyvind Harboe Embedded software and hardwar

Re: [Openocd-development] [PATCH] debug message

2009-09-16 Thread Øyvind Harboe
Have a bit of faith & patience here. What I just suggested to Rolf was an approach where we net will *delete* quite a bit of code. Rolf posted a patch to remove something annoying. We're all agreed the superfluous warnings are annoying. That patch made one thing better and another thing worse. Th

Re: [Openocd-development] [PATCH] debug message

2009-09-16 Thread Magnus Lundin
Øyvind Harboe wrote: > 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 sti

Re: [Openocd-development] [PATCH] debug message

2009-09-16 Thread Øyvind Harboe
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 targ

Re: [Openocd-development] [PATCH] debug message

2009-09-16 Thread Øyvind Harboe
On Wed, Sep 16, 2009 at 5:04 PM, Magnus Lundin wrote: > Øyvind Harboe wrote: >> >> Use the source Luke :-) >> >> > > I most certainly do. > > But you vere saying that this particular patch breaks the error reporting > in other places. And in my linited knowlege of the source, this is not the > cas

Re: [Openocd-development] [PATCH] debug message

2009-09-16 Thread Magnus Lundin
Øyvind Harboe wrote: > Use the source Luke :-) > > I most certainly do. But you vere saying that this particular patch breaks the error reporting in other places. And in my linited knowlege of the source, this is not the case. It is like having malloc writing error messages to the console. An

Re: [Openocd-development] [PATCH] debug message

2009-09-16 Thread Øyvind Harboe
Use the source Luke :-) -- Ø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

Re: [Openocd-development] [PATCH] debug message

2009-09-16 Thread Magnus Lundin
>> The proposed patch does not try to solve the general problem of >> errorhandling in OpenOCD. It simply wants to change the debug level at >> which this exception is reported to the user. >> >> Whats the problem ?? > > The attached patch *breaks* error reporting in other places. > > > -- > Øyvin

Re: [Openocd-development] [PATCH] debug message

2009-09-16 Thread Øyvind Harboe
> The proposed patch does not try to solve the general problem of > errorhandling in OpenOCD. It simply wants to change the debug level at > which this exception is reported to the user. > > Whats the problem ?? The attached patch *breaks* error reporting in other places. -- Øyvind Harboe Embed

Re: [Openocd-development] [PATCH] debug message

2009-09-16 Thread Magnus Lundin
>> I think this is OK, it does not change the return value, it is still >> reported as an error/exception condition, not ERROR_OK. So for the >> codebase nothing is changed. In the calling functions we do fall back to >> smaller buffers or alternative implementations. So the error warning >> should

Re: [Openocd-development] [PATCH] debug message

2009-09-16 Thread Øyvind Harboe
> I think this is OK, it does not change the return value, it is still > reported as an error/exception condition, not ERROR_OK. So for the > codebase nothing is changed. In the calling functions we do fall back to > smaller buffers or alternative implementations. So the error warning > should be g

Re: [Openocd-development] [PATCH] debug message

2009-09-16 Thread Magnus Lundin
> Hi, > > This turns a warning into a debug message. It is printed if there is not > as much working area as requested. Many callers try iteratively until a > working area of suitable size is found. The current warnings are > irritating. > > It should be up to the caller to decide if this is worth

Re: [Openocd-development] [PATCH] debug message

2009-09-16 Thread Øyvind Harboe
This patch needs work. OpenOCD lacks the exception concept of a "try-catch". There are other cases where we *do* want error messages. -- Øyvind Harboe Embedded software and hardware consulting services http://www.zylin.com ___ Openocd-development mai

[Openocd-development] [PATCH] debug message

2009-09-16 Thread Rolf Meeser
Hi, This turns a warning into a debug message. It is printed if there is not as much working area as requested. Many callers try iteratively until a working area of suitable size is found. The current warnings are irritating. It should be up to the caller to decide if this is worth a warning. M