Re:Show HN: Uscope, a New Linux Debugger Written from Scratch
by quotemstr on Friday January 31, 2025 @03:52PM
(#42891823)
> excepting weird hacks like evaluating `print c.begin()` and catching it output)
Why do you consider that a weird hack instead of legitimate programming technique?
Re:Show HN: Uscope, a New Linux Debugger Written from Scratch
by feelamee on Friday January 31, 2025 @05:28PM
(#42893058)
If this is not weird hack, why gdb provide api for getting C++ variables values instead of using this "legitimate programming technique"?
Re:Show HN: Uscope, a New Linux Debugger Written from Scratch
by leni536 on Friday January 31, 2025 @05:06PM
(#42892774)
> one time I wanted to write generic printers. E.g. printer of any type which support C++ iterators.
How would that work for types where the required functions are not instantiated, or not instantiated as a standalone function? Most iterators' operator++ are inlined and probably never instantiated as a distinct function.
Re:Show HN: Uscope, a New Linux Debugger Written from Scratch
by feelamee on Friday January 31, 2025 @05:26PM
(#42893026)
> How would that work for types where the required functions are not instantiated
Obviously, it will not. But why not to try?)
> Most iterators' operator++ are inlined
Sure, it's sad.
But I'm still think that such feature - calling C++ functions from Python API - can be useful.
one time I wanted to write generic printers. E.g. printer of any type which support C++ iterators. But gdb can't call C++ functions from python api (excepting weird hacks like evaluating `print c.begin()` and catching it output). Although this is not very useful because most of types we use changes very rarely, that's why writing printers is only matter of time.
Another feature is breakpoints which sleep next N seconds. We have breakpoints which can skip next N triggering, but similar with time will be useful to me to debug mouse events in gui apps, etc.
Also the most new gdb still have problems with tab-tab completion (and even Ctrl-C don't return control immediately).
Also lately I often meet problem cannot insert breakpoint 0. Probably this is a bug, because answers from stackoverflow isn't relevant for me