[vtkusers] breaking after vtkErrorMacro

Dominik Szczerba dominik at itis.ethz.ch
Fri Nov 7 09:41:18 EST 2008


Thanks a lot, Goodwin already suggested this solution independently, but 
the thing is it is an object inside the filter that emits this event, 
and the filter is not catching it. Observing the filter did not help me 
here - or is there a way to enable 'recursive' events?
with regards,
Dominik

Amy Squillacote wrote:
> Hi Dominik,
> 
>  From looking at the code in vtkSetGet.h for vtkErrorMacro, it seems 
> that if something is observing the "ErrorEvent", then that event is 
> invoked. Perhaps you could add an observer to the filter that has this 
> problem -- specifically listening for the "ErrorEvent". Then you could 
> exit gracefully in your event handler.
> 
> - Amy
> 
> Dominik Szczerba wrote:
>> Thanks for a hint, but I need to handle this case in a release version 
>> (no debugger). I looked up the vtkErrorMacro and it indeed calls 
>> BreakOnError() at the end. Is there a chance to attach own code there?
>>
>> Thanks,
>> Dominik
>>
>> Goodwin Lawlor wrote:
>>> Dominik Szczerba wrote:
>>>> Is there a way to stop execution after vtkErrorMacro?
>>>> I get a malloc failure in a VTK filter that is not checked for in 
>>>> the parent calling stack... (bug report due). pointer==0 is detected 
>>>> (if ptr==0 vtkErrorMacro... return 0) but execution continues 
>>>> (leading into bushes).
>>>> If not, what do I do to exit gracefully on a malloc quit?
>>>
>>> Hi Dominik,
>>>
>>> You can place a debugger break on vtkObject::BreakOnError()
>>>
>>> hth
>>>
>>> Goodwin
>>>
>>
> 

-- 
Dominik Szczerba, PhD
Computational Physics Group
IT'IS Foundation for Research
http://www.itis.ethz.ch



More information about the vtkusers mailing list