Originally posted by AndyChow
View Post
Announcement
Collapse
No announcement yet.
The State Of GNU's GDB Conversion To C++
Collapse
X
-
Originally posted by xeekei View PostSlightly over my head, but this means that GDB will be able to debug both C++ and C instead of just C?Last edited by pal666; 10 October 2017, 10:37 PM.
- Likes 1
Comment
-
Originally posted by carewolf View PostAlmost all of C++ is zero overhead. Just avoid exceptions
Originally posted by carewolf View PostEdit: foreach is a bad example though, it needs stl or stl-like containers
Originally posted by carewolf View Postespecially if they want to avoid all the STL stuff
Originally posted by carewolf View Post, and just want some better language features.
- Likes 3
Comment
-
Originally posted by orome View PostExceptions introduce their own overhead in setting up the catch frame.
Originally posted by orome View PostUsing RTTI (features like dynamic_cast) also adds overhead. Both can be turned off though,
Originally posted by orome View Postand there are c++ projects which don't use them.Last edited by pal666; 10 October 2017, 10:35 PM.
- Likes 1
Comment
-
Originally posted by pal666 View Postactually exceptions have negative overhead, when you compare them to real c replacement(checking of error result after every function call and propagating errors to caller). but most people are too stupid and compare "error handling using exceptions" vs "no error handling at all"
you are bad c++ programmer though, foreach works with plain arrays http://coliru.stacked-crooked.com/a/9c43f0f0e2a28928
which would be really stupid thing, and so gdb does use stl (and std strings which are "stl-like containers")
Last edited by carewolf; 11 October 2017, 03:12 AM.
Comment
-
Originally posted by pal666 View Postexceptions eliminate overhead of checking error results after every function call
you don't have to turn rtti off, you can just avoid using it. but then you will have to use something else and chances are it will be even slower. turning it off just saves some harddrive space, which is cheap anyway
there is no shortage of stupid c++ projects. luckily gdb is not one of them
Comment
-
Originally posted by orome View Post
Exceptions introduce their own overhead in setting up the catch frame. Using RTTI (features like dynamic_cast) also adds overhead. Both can be turned off though, and there are c++ projects which don't use them. virtual functions certainly beat the C approach of 'struct of function pointers'.
- Likes 3
Comment
-
Originally posted by carewolf View PostThe C replacment is signals. Exceptions are not for error-handling, it is for handling exceptional application behavior that should result in app shutdown.
Originally posted by carewolf View PostAnd you are a offensively stupid. To use it you would still need to first declare a wrapper class which is more code than just iterating over it normally. And that is if you have length. Using it with zero terminated arrays would not be good, and they are still unfortunately common in C code.
Originally posted by carewolf View PostApparently there no shortage of developer thinking they know C++ but has no clue. You can't use RTTI if you use plugins. So any project with plugins do not rely on it, because they unlike you, know what they are doing.
- Likes 2
Comment
-
Originally posted by carewolf View PostThe C replacment is signals. Exceptions are not for error-handling, it is for handling exceptional application behavior that should result in app shutdown.
- Likes 2
Comment
-
Originally posted by carewolf View PostThe C replacment is signals. Exceptions are not for error-handling, it is for handling exceptional application behavior that should result in app shutdown.
Originally posted by carewolf View PostTo use it you would still need to first declare a wrapper class which is more code than just iterating over it normally.
Originally posted by carewolf View PostAnd that is if you have length. Using it with zero terminated arrays would not be good, and they are still unfortunately common in C code.
if we are talking about non-trivial project, it is less code than all its "normal" iterations and less chances to make an error by comparing or incrementing wrong value
- Likes 1
Comment
Comment