Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-debug-dev] Idle thoughts on NPE and debugging outside a CDT project

> 
> Just some numbers from Bugzilla.
> 
> - 2842 bugs had NPE in the summary
> - 3943 had NullPointerException in a comment
> 
> There are ~80k bugs in bugzilla.
> 
> Thats >5%
> 
> I think it would be difficult to come up with as many hits=20
> for some other programming pattern.
> 

We also could design code like this:

try {
// do something.
} catch (Exception e) {
}

IMHO, This is lazy programming and pushing the problem under the rug.
NPEs should not be discarded but look at on a case by case basis.
NPE is usually a symptom of more deeper flaws, masking the symptoms will
not fix the problem.

Yes, there are cases where NPEs should be ignore:
In your PR to CDT/Debug/MI, lots of your fixes were just to ignore the exceptions,
We've accepted ...because, well .. gdb fires exceptions for no good reasons and we simply
lack the fuzzy logic to recognize relevant messages form irrelevant ones,
i.e. "Can not access memory 0xxxxxx", althought gdb can still run fine.




Back to the top