TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

262 点作者 jcalabro3 个月前
Hi! I&#x27;ve been building a debugger on my nights and weekends because it&#x27;s fun, and I personally need a better debugger for my work. GDB and LLDB pain me greatly; we can and will do better!<p>As explained in the README, it&#x27;s still very early-days and it&#x27;s not ready for use yet, but check back often because it&#x27;s improving all the time!<p>Check out <a href="https:&#x2F;&#x2F;calabro.io&#x2F;uscope" rel="nofollow">https:&#x2F;&#x2F;calabro.io&#x2F;uscope</a> for a more detailed explanation.<p>Thanks for taking a look!

26 条评论

feelamee3 个月前
&gt; The available Linux debuggers are gdb and lldb. They both suck. They crash all the time, don&#x27;t understand the data types I care about, and they don&#x27;t make the data I need available at my fingertips as quickly as possible.<p>quote from <a href="https:&#x2F;&#x2F;calabro.io&#x2F;uscope" rel="nofollow">https:&#x2F;&#x2F;calabro.io&#x2F;uscope</a><p>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 crashing of course), but I dont know anything better. I am forced to use visual studio at work and its debugger really sucks - it can&#x27;t even compare strings in conditional breakpoint, it cant even skip all std::function &#x2F; std::bind garbage to let me step in callback, it can&#x27;t watch evaluated expressions. Probably it can evaluate exprs (immediate window?), but there are very little guides about this.<p>So, gdb is winner for me now. <i>rr</i> (record-repeat)[0] also looks very nice, but it require hardware support(((<p>[0] <a href="https:&#x2F;&#x2F;rr-project.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;rr-project.org&#x2F;</a>
评论 #42890946 未加载
评论 #42893391 未加载
评论 #42891919 未加载
评论 #42892482 未加载
评论 #42894268 未加载
评论 #42893801 未加载
godelski3 个月前
<p><pre><code> &gt; Build as a library so other people can build other interesting things as well </code></pre> I LOVE this!<p>I firmly believe so much tech has gone to shit because things are no longer hackable. We say &quot;move fast and break things&quot; but we try so hard to prevent that that when we do break things we just create bigger messes and debt, so no one cleans it up. It seems slower to write hackable code but that&#x27;s in the moment. In the long run it is much faster. Not to mention you get added benefits of others being able to contribute more easily with a lower likelihood of actually breaking shit.
评论 #42890468 未加载
tux19683 个月前
This is great to see. It&#x27;d be lovely if Linux gets a decent debugger. Another project to keep an eye on is <a href="https:&#x2F;&#x2F;github.com&#x2F;EpicGamesExt&#x2F;raddebugger">https:&#x2F;&#x2F;github.com&#x2F;EpicGamesExt&#x2F;raddebugger</a> Although, they haven&#x27;t expanded much beyond Windows, yet.
评论 #42895417 未加载
tux19683 个月前
Author just did a podcast about Uscope a few minutes ago, where they mention this HN post:<p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;stWBTv6grBc" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;stWBTv6grBc</a><p>Mentioned at : <a href="https:&#x2F;&#x2F;youtu.be&#x2F;stWBTv6grBc?t=456" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;stWBTv6grBc?t=456</a>
lsllc3 个月前
Looks promising -- it&#x27;s about time, I haven&#x27;t been satisfied with any debugger since the days of Periscope!<p><a href="https:&#x2F;&#x2F;www.os2museum.com&#x2F;files&#x2F;docs&#x2F;periscope&#x2F;periscope-manual-m54.pdf" rel="nofollow">https:&#x2F;&#x2F;www.os2museum.com&#x2F;files&#x2F;docs&#x2F;periscope&#x2F;periscope-man...</a>
评论 #42890001 未加载
IAmLiterallyAB3 个月前
Yay this is awesome! GDB is a buggy (<a href="https:&#x2F;&#x2F;sourceware.org&#x2F;bugzilla&#x2F;show_bug.cgi?id=18772" rel="nofollow">https:&#x2F;&#x2F;sourceware.org&#x2F;bugzilla&#x2F;show_bug.cgi?id=18772</a> <a href="https:&#x2F;&#x2F;sourceware.org&#x2F;bugzilla&#x2F;show_bug.cgi?id=9425" rel="nofollow">https:&#x2F;&#x2F;sourceware.org&#x2F;bugzilla&#x2F;show_bug.cgi?id=9425</a>) mess and rough code quality, I&#x27;ve wanted a do something like this for a while.<p>To be 100% clear, it&#x27;s not using gdb&#x2F;gdbserver under the hood right?<p>The bugs I linked above are over a decade old, and I have to patch them every time I compile GDB server. Ultimately (IIRC) GDB needs to rework how it handles signals (to their credit, ptrace is a horribly stupid API, especially before PTRACE_SEIZE, so I don&#x27;t blame them for having issues)
评论 #42898929 未加载
jcranmer3 个月前
This is definitely an ambitious project, and I worry that you are biting off more than you can chew in doing so. (I&#x27;ve attempted my fair share of debugger projects in the past).<p>At a low level, one of the main problems is that Linux&#x27;s kernel interfaces for debugging are just absolute trash. (I see you have multithreaded support mentioned as a future task item, and that&#x27;s one of the areas where you discover just how bad it really is). And of course ptrace composes somewhat poorly with, well, anything else, so if you want to use perf_event or eBPF to help drive the low-level stuff, well, combining everything into a single event loop is just painful. (Oh, and the documentation for all of this stuff sucks.)<p>At the medium level, everything is hampered by the number of secret handshakes that go on between the compiler, the linker, the runtime loader, the debugger. And the chronic issue that, in the debugger, you have to be prepared for the possibility that everything is just catastrophically wrong: your stack might be garbage (or downright nonexistent), the thread-local storage register might be a garbage value, variables may have values that don&#x27;t make sense. After all, you&#x27;re resorting to a debugger when things don&#x27;t work, and part of the reason why it might not be working is because you&#x27;ve accidentally corrupted everything.<p>And at the high level, there&#x27;s the UI which, as someone who doesn&#x27;t work on UI, I find terrifying in its own right.<p>Trying to solve not one of these issues, but all of them, at once, in a new project is ambitious. I&#x27;d personally prefer a lot more a project that only tried to tackle one slice of the stack, not all of it.
评论 #42893992 未加载
AndyKelley3 个月前
He&#x27;s live on twitch right now demoing this on zig showtime: <a href="https:&#x2F;&#x2F;www.twitch.tv&#x2F;kristoff_it" rel="nofollow">https:&#x2F;&#x2F;www.twitch.tv&#x2F;kristoff_it</a>
评论 #42894492 未加载
titzer3 个月前
Nice project!<p>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&#x27;s great.<p>As one of those long-tail &quot;native&quot; languages, Virgil might benefit from this. So far, I&#x27;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 many ways. I think DWARF draws the wrong dividing line here. Control of the machine and customizing the source-level support to the language is probably better.
评论 #42893242 未加载
评论 #42894566 未加载
评论 #42891531 未加载
s3graham3 个月前
Keep at it!<p>raddbg is one worth watching too (currently only Windows x64) <a href="https:&#x2F;&#x2F;github.com&#x2F;EpicGamesExt&#x2F;raddebugger">https:&#x2F;&#x2F;github.com&#x2F;EpicGamesExt&#x2F;raddebugger</a>
meitham3 个月前
Very happy to see the increasing momentum in the zig community
koek673 个月前
Nice work! I remember meeting you at Systems Distributed in NYC where you mentioned this project, so cool to see the progress. Well done!
zwieback3 个月前
Everyone here seems to thing GDB is awful. It&#x27;s been a while for me but I remember using front-ends like Eclipse&#x27;s CDT or similar and didn&#x27;t find that experience so bad. Do most people use GDB straight-up? I haven&#x27;t done that in probably 15 years although it&#x27;s nice to have a lightweight command line on small embedded systems.
评论 #42893137 未加载
评论 #42891774 未加载
评论 #42954211 未加载
mort963 个月前
This is exciting! I use GDB and LLDB, but their TUIs&#x2F;CLIs make certain things difficult (I feel like debugging seriously benefits from a proper GUI) and graphical front-ends I&#x27;ve tried are pretty janky. Looking forward to trying it out, but I&#x27;m excited to see something happening in this space.
mplemay3 个月前
This opinion is not backed by facts, any insight about linux (or even the languages in question), or even related to this post. Nevertheless, I wonder if it was a good idea to allow rust contributions to the linux project. From all of the bits and pieces I read about zig (including this project), I feel like it would have been better aligned (than rust) to pick up where the mainly C codebase left off.
评论 #42890832 未加载
评论 #42891012 未加载
评论 #42897199 未加载
gregthelaw3 个月前
Congrats on this work -- writing a debugger from scratch is a big job. I have cloned the repo, will take a proper look this w&#x2F;e.
MaximilianEmel3 个月前
How does it compare to gf?<p><a href="https:&#x2F;&#x2F;github.com&#x2F;nakst&#x2F;gf">https:&#x2F;&#x2F;github.com&#x2F;nakst&#x2F;gf</a>
评论 #42890234 未加载
quotemstr3 个月前
It&#x27;s not clear to me why we&#x27;d need a new debugger instead of GDB enhancements. GDB has an extensible, modern C++ codebase with literal decades of hard earned knowledge baked into it.<p>How are we better off rewriting it, especially if the rewrite isn&#x27;t memory safe?
评论 #42890184 未加载
评论 #42890188 未加载
评论 #42889942 未加载
评论 #42890312 未加载
评论 #42890291 未加载
breatheoften3 个月前
Super supportive as I really value debuggers as tools even tho they are horror shows to use!<p>&gt; Similarly, the following features are non-goals of the project:<p>&gt; Supporting non-native languages (i.e. Java, Python, etc.)<p>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 &#x2F; very low-class experiences.<p>Properly integrating with the python interpreter to be able to debug python + c&#x2F;cpp extensions running in the same process is a huge missing whole in the debugger market.<p>I don&#x27;t know how other people do it but I &#x27;solve&#x27; this problem by attaching either a python debugger or lldb to the python process -- meaning I can debug either python or the cpp but not both at the same time. The experience is very lacking. Even just seeing the python call-stack while paused at a cpp breakpoint would be huge.
评论 #42893187 未加载
mamcx3 个月前
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 <i>well</i><p>In general, if something is large (text, arrays, etc) all bets are off.<p>Basically, something like this:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;okbob&#x2F;pspg">https:&#x2F;&#x2F;github.com&#x2F;okbob&#x2F;pspg</a><p>---<p>The second thing that is very hard with debuggers, is to tell them <i>what to skip</i>.<p>In the normal sense of &#x27;I don&#x27;t wanna debug Rust std&#x27; but also &#x27;What the heck, why is stepping into #[Debug]???&#x27;
armitron3 个月前
GDB (I don&#x27;t use LLDB) is fully programmable and has multiple user interfaces (TUI, Emacs, DDD, graphical frontends and various .gdbinit configurations that emulate SoftICE L&amp;F).<p>It&#x27;s a power tool and takes some time and effort to learn and master. Superficially dismissing it &#x2F; wasting your time with something that in all likelihood will end up going nowhere while lacking most features that make GDB great, does not a good recommendation make.<p>At least you&#x27;ll probably learn a thing or two while you implement it, but I&#x27;d rather not waste my time using it.
drewg1233 个月前
How entwined is it with Linux specific APIs? Eg, how hard would it be to port to FreeBSD?
ribs3 个月前
TotalView (which I rep), Linaro DDT - thoughts? (Yes, they’re both proprietary)
评论 #42890636 未加载
bieganski3 个月前
&gt; The available Linux debuggers are gdb and lldb. They both suck. They crash all the time, don&#x27;t understand the data types I care about, and they don&#x27;t make the data I need available at my fingertips as quickly as possible.<p>Okay, so this is the author&#x27;s answer to the most important question: &quot;why?&quot;<p>For me this is a serious issue, making strong statements without any single backing example. If you experience crashes, please report to the maintainers - i guarantee that you won&#x27;t be ignored. You say that it&#x27;s missing some data that you need? Fine, but be precise - what data?<p>Otherwise it sounds like a &quot;yeah, let&#x27;s make a project for fun and pretend that it&#x27;s serious by finding sort-of-justification&#x2F;use case&quot; (i&#x27;m not telling that it is the case for you - i&#x27;m telling that it sounds like it, based on your own description).<p>Also, would you feel nice if i put in my project&#x27;s README a note that the project of you, the one that you put your effort to, &quot;sucks&quot;?
评论 #42891433 未加载
评论 #42891417 未加载
rickydroll3 个月前
Make it debug systemd config problems and I&#x27;d be thrilled.
adolph3 个月前
To clarify “from scratch” as in from basic materials and not “in scratch” as in the MIT graphical programming g system[0]. It appears to be written in Zig[1], which I find interesting for analysis.<p>0. <a href="https:&#x2F;&#x2F;scratch.mit.edu&#x2F;" rel="nofollow">https:&#x2F;&#x2F;scratch.mit.edu&#x2F;</a><p>1. <a href="https:&#x2F;&#x2F;github.com&#x2F;jcalabro&#x2F;uscope">https:&#x2F;&#x2F;github.com&#x2F;jcalabro&#x2F;uscope</a>
评论 #42889804 未加载
评论 #42890124 未加载