TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Debugging a Debugger

48 pointsby id_risover 9 years ago

2 comments

userbinatorover 9 years ago
<i>It&#x27;s a really powerful way to debug as you can automate much of the debugging process and do things that aren&#x27;t practical without scripting.</i><p>IMHO when debugging software needs to be automated to the point that a library needs to be written (and itself debugged), there&#x27;s an underlying problem which can&#x27;t be solved with adding more layers of complexity - as that will only introduce <i>more</i> bugs. When these bugs are in the software you&#x27;re using to debug, things can quickly take a turn for the worse.<p>Is that code really taking the user&#x27;s input (a string), getting object addresses and offsets (numbers) from that, then converting those into strings to build a command string, which then gets parsed back into numbers for the debugger to ultimately use to create a watchpoint? I think that is itself a good example of how the &quot;more code, more bugs&quot; principle can apply: all this superfluous conversion code has introduced a bug.<p>Here&#x27;s a good article about that, although it doesn&#x27;t mention the situation where the bugs you introduce end up being in the software you need to use to remove bugs...<p><a href="http:&#x2F;&#x2F;blog.codinghorror.com&#x2F;the-best-code-is-no-code-at-all&#x2F;" rel="nofollow">http:&#x2F;&#x2F;blog.codinghorror.com&#x2F;the-best-code-is-no-code-at-all...</a>
评论 #10447623 未加载
评论 #10447446 未加载
erydoover 9 years ago
He identified a bug in the function `evaluateIntegerExpression` which parses an integer literal from LLDB, erroneously always parsing in base-16.<p>But the pull request he created (<a href="https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;chisel&#x2F;pull&#x2F;117" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;chisel&#x2F;pull&#x2F;117</a>) didn&#x27;t fix that; instead it just replaced that function call with manually parsing the literal in the one specific place he was having problems with.<p>Did I miss something there? That seems like a really weird &quot;solution&quot;. Why not just fix the original function?
评论 #10447574 未加载