Live data from Hacker News

Show HN: Uscope, a new Linux debugger written from scratch

github.com

71–80 of 133 posts

Re: Show HN: Uscope, a new Linux debugger written from scratch

#71

Super supportive as I really value debuggers as tools even tho they are horror shows to use! > Similarly, the following features are non-goals of the project: > Supporting non-native languages (i.e. Java, Python, etc.) But I think that position is likely a mistake in terms of leaving killer features on the table and baking in architecture decisions that might continue to make these kinds of features impossible / very…

We've got a prototype of debugging in python and C/C++ in GDB - https://undo.io/resources/how-i-debug-python-code-with-a-tim...

If you'd like to try it please get in touch, feedback is always useful.

Re: Show HN: Uscope, a new Linux debugger written from scratch

#72
post #38

Nice project! One killer feature would be the ability to connect to the debugger via a socket and control it. Gdb has this interface and for some use cases it's great. As one of those long-tail "native" languages, Virgil might benefit from this. So far, I've had a student build a DWARF backend, and the experience from that is that DWARF is way too complicated and consequently implementations are broken and crappy in…

Speaking as a Java guy, remote debugging is SO useful (at times anyway). Thankfully the JVM has built in support for a remote debugging protocol[1] and there are good debuggers that can connect to a running Java system (if it was started with the correct command line flags) and do symbolic debugging over the network.

There can be certain situations where the network latency can make things difficult, but generally speaking I find it an incredibly useful facility to have.

[1]: https://docs.oracle.com/javase/8/docs/technotes/guides/jpda/...

Re: Show HN: Uscope, a new Linux debugger written from scratch

#73

Earlier quoted context omitted.

Not really. Zig's answer to safety is mostly based on runtime panics, and the kernel really, really hates panics. As such, the only thing left is better ergonomics, and that's not really worth the effort to switch. Rust isn't being adopted because it's an easier language to code in, and in fact it's being adopted in spite of the fact that it's harder to code in. And that's because to some kernel devs, the promise of…

> Zig's answer to safety is mostly based on runtime panics This statement is nonsensical. Zig's answer to safety is based on a precise type system and a simple language that helps the programmer in their quest to write perfect code. If a kernel panics, that is either a bug or hardware failure.

I actually find that their comment makes a lot more sense than yours.

Re: Show HN: Uscope, a new Linux debugger written from scratch

#74

Earlier quoted context omitted.

If you're willing to deal with enterprise pricing, Undo [0] implements something reasonably comparable to rr without the hardware timer requirements. [0] https://undo.io/

eh, thanks > How can I persuade my boss to pay for Undo? fun quote.. but my boss will never pay for it because I am the only one who use gdb in our company, unfortunately)

For what it's worth we do offer a more printf-y interface for people who don't like a debugger - https://docs.undo.io/PostFailureLogging.html

And CLion / VS Code for people who prefer an IDE interface.

But a lot of people do really want to stick with their printf debugging.

If your boss won't buy you an Undo you can still use https://rr-project.org/ - or on Windows the built in time travel debug of WinDbg.

Re: Show HN: Uscope, a new Linux debugger written from scratch

#75

> The available Linux debuggers are gdb and lldb. They both suck. They crash all the time, don't understand the data types I care about, and they don't make the data I need available at my fingertips as quickly as possible. quote from https://calabro.io/uscope Of course gdb, lldb have their problems (e.g. smashing tui with app output, what can be easily fixed, or very very very very long tab-tab completion, and crash…

  > gdb(..) smashing tui with app output
this got me losing my mind. How/why propose this tempting TUI mode when the result looks like a broken arcade game ??

How do you people comfortably debug C in Linux ? I know VSCode looks nice but by principle I can't accept to use such a beast to basically edit code..

Re: Show HN: Uscope, a new Linux debugger written from scratch

#76

Earlier quoted context omitted.

Not really. Zig's answer to safety is mostly based on runtime panics, and the kernel really, really hates panics. As such, the only thing left is better ergonomics, and that's not really worth the effort to switch. Rust isn't being adopted because it's an easier language to code in, and in fact it's being adopted in spite of the fact that it's harder to code in. And that's because to some kernel devs, the promise of…

> Zig's answer to safety is mostly based on runtime panics This statement is nonsensical. Zig's answer to safety is based on a precise type system and a simple language that helps the programmer in their quest to write perfect code. If a kernel panics, that is either a bug or hardware failure.

> This statement is nonsensical.

You're right, my bad. It is hard to be precise in a comment where I'm trying to be as concise as possible.

I'm sure you know what I mean though, with regards to temporal memory safety (lifetimes), data races (Send/Sync traits), etc. Rust works by preventing many classes of bugs through compile errors, rather than panics.

> If a kernel panics, that is either a bug or hardware failure.

And this is where Rust differs; Rust will reduce the likelihood of bugs from happening in the first place. I'm not saying Zig doesn't also do that, Rust just does it more.

The Rust compiler devs, in their quest to make a type system that is powerful enough to catch most memory corruption errors, somehow came up with something that can be used to catch far more issues than just that.

The affine(ish) type system, coupled with lifetimes, makes modeling and maintaining correct states much easier than in Zig, for all sorts of objects and abstractions.

From what I've read from Linus on LKML/lore along the years, a kernel oops/panic is seen as one of the worst things that could happen to it; there is generally nothing the user can do at that point to debug it (they likely won't even see the console), and makes the machine unusable for all other tasks. Sometimes you might be lucky and just kill and collect the thread that panicked, but oftentimes you get the nuclear OOPS option. With Zig you don't even get the option to catch it via something like catch_unwind.

Re: Show HN: Uscope, a new Linux debugger written from scratch

#77
One thing that as far as I know no single debuggers has (except FoxPro from DOS) is the ability to show a large list of things, but well

In general, if something is large (text, arrays, etc) all bets are off.

Basically, something like this:

https://github.com/okbob/pspg

---

The second thing that is very hard with debuggers, is to tell them what to skip.

In the normal sense of 'I don't wanna debug Rust std' but also 'What the heck, why is stepping into #[Debug]???'

Re: Show HN: Uscope, a new Linux debugger written from scratch

#78

> The available Linux debuggers are gdb and lldb. They both suck. They crash all the time, don't understand the data types I care about, and they don't make the data I need available at my fingertips as quickly as possible. quote from https://calabro.io/uscope Of course gdb, lldb have their problems (e.g. smashing tui with app output, what can be easily fixed, or very very very very long tab-tab completion, and crash…

If you're willing to deal with enterprise pricing, Undo [0] implements something reasonably comparable to rr without the hardware timer requirements. [0] https://undo.io/

Are you aware of solutions for multi-threaded and relative time-accurate recordings, for example by using user-selected synchronization points? Afaiu, rr and undo do simulation of threads on one CPU core, which rules out detecting timing issues.

Re: Show HN: Uscope, a new Linux debugger written from scratch

#79
post #75

> The available Linux debuggers are gdb and lldb. They both suck. They crash all the time, don't understand the data types I care about, and they don't make the data I need available at my fingertips as quickly as possible. quote from https://calabro.io/uscope Of course gdb, lldb have their problems (e.g. smashing tui with app output, what can be easily fixed, or very very very very long tab-tab completion, and crash…

> gdb(..) smashing tui with app output this got me losing my mind. How/why propose this tempting TUI mode when the result looks like a broken arcade game ?? How do you people comfortably debug C in Linux ? I know VSCode looks nice but by principle I can't accept to use such a beast to basically edit code..

as I said - this easy to fix once and for ever

Also not all apps write to stdout/stderr by default.

> How do you people comfortably debug C in Linux ?

It depends on what comfortable is for you. Most of my pc experience is terminal and browser and this is comfortable for me. I just use gdb for debugging. Sometimes trying lldb

Re: Show HN: Uscope, a new Linux debugger written from scratch

#80
post #75

> The available Linux debuggers are gdb and lldb. They both suck. They crash all the time, don't understand the data types I care about, and they don't make the data I need available at my fingertips as quickly as possible. quote from https://calabro.io/uscope Of course gdb, lldb have their problems (e.g. smashing tui with app output, what can be easily fixed, or very very very very long tab-tab completion, and crash…

> gdb(..) smashing tui with app output this got me losing my mind. How/why propose this tempting TUI mode when the result looks like a broken arcade game ?? How do you people comfortably debug C in Linux ? I know VSCode looks nice but by principle I can't accept to use such a beast to basically edit code..

> How do you people comfortably debug C in Linux?

same way I debug everything, everywhere: logging.

Post reply on HN