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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Debug your programs like they're closed source

126 点作者 zimbu668超过 10 年前

8 条评论

cottonseed超过 10 年前
I used to work for a (no defunct) company, ARDI, that made a Mac emulator. We dynamically translated 68K to x86 and did a clean room reimplementation of Mac OS 9. (Yes, crazy.) Much of the job involved debugging the OS when running 3rd party software (binaries). The first step was to collect a syscall trace. Then lots of thought experiments. It was a great way to develop extreme debugging skills.
评论 #8926646 未加载
评论 #8927263 未加载
userbinator超过 10 年前
Syscall tracing works well for debugging applications or pieces of one that interact externally, or for ensuring that the OS is doing what you think it should, but I&#x27;ve found that more often than not the buggy part is &quot;inside&quot;; e.g. if an output file is incorrect, you would be able to see the incorrect data being written to it via the OS (which would&#x27;ve been clear from inspecting the file itself), but not what lead to that.<p>Coincidentally, I prefer to use an Asm-level debugger (WinDbg, OllyDbg) whenever I need to use one - which for debugging something I wrote, is not very often. Maybe it has to do with the fact that I started with Asm and disassembling other programs, so it&#x27;s relatively straightforward to map between source code and the instructions the compiler generated. This also helped with figuring out a very subtle compiler bug - I know that they&#x27;re quite rare, but when they do occur, they tend to be <i>extremely</i> difficult to figure out otherwise.
评论 #8928154 未加载
评论 #8928015 未加载
basicallydan超过 10 年前
Great article, very interesting! I never knew about this :)<p>For those on OSX, `dtruss` seems to work in more-or-less the same way.<p><pre><code> sudo dtruss -t open ssh whatever.com </code></pre> More info on stack overflow: <a href="http://stackoverflow.com/questions/1925978/equivalent-of-strace-feopen-command-on-mac-os-x" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;1925978&#x2F;equivalent-of-str...</a>
评论 #8926355 未加载
评论 #8926598 未加载
Terr_超过 10 年前
For those on Windows, the excellent System Internals suite contains &quot;Process Monitor&quot;, which does pretty much what you&#x27;d expect, allowing you to see all sorts of file (and registry) activity.
评论 #8926906 未加载
评论 #8926568 未加载
评论 #8926473 未加载
评论 #8927306 未加载
jordigh超过 10 年前
Ah, an article on tracing.<p>I am very impressed by lttng myself:<p><a href="http://lttng.org/" rel="nofollow">http:&#x2F;&#x2F;lttng.org&#x2F;</a>
akkartik超过 10 年前
Everytime I read about strace I feel guilty about not having tried it out.<p>Another awesome story: <a href="http://lwn.net/1999/0121/a/mec.html" rel="nofollow">http:&#x2F;&#x2F;lwn.net&#x2F;1999&#x2F;0121&#x2F;a&#x2F;mec.html</a>
antoaravinth超过 10 年前
Even though I havent followed the above idea ( I will try to do in sometime ), I have followed this way, which have helped me a lot.<p>I used to make guess when I debug my day to day problem. Say for example, when I run selenium, and the browser doesn&#x27;t open up:<p>1. Does the jar is valid? 2. Safari has selenium plugin? 3. Have custom installation rather than default installation location?<p>Then the smart you make the guess, the smart you can solve the problem.<p>Its about removing the un-wanted space ( by making smart guess ) and debugging the right space.
Nutomic超过 10 年前
I&#x27;m curious, is there anything like this for Android and calls to any Java system functions?<p>(it should be possible with XPrivacy)