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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

How DWARF Works

32 点作者 jcalabro8 个月前

2 条评论

khuey8 个月前
One nit to pick<p>&gt; It&#x27;s a bit tough to tell because we&#x27;re only one function call deep, but this data is stored in a tree.<p>The call graph doesn&#x27;t actually appear (with one exception, see below) in the DWARF. DWARF is a tree of the program constructs <i>as they appear in the source</i>. Local variables are children of the function they appear in. Member variables are children of the class they appear in. Global variables are children of the namespace or compilation unit they appear in. Functions are children of the namespace, class, or compilation unit they appear in, etc.<p>The exception to this is inlined functions. Inlines are represented with two pieces. DWARF for the function is emitted in the place where it appears in the source describing things that are shared across every instance of the function, like its return type, names of its parameters and local variables, etc. Then at each inlined site, a special inline entry is emitted. This special inline entry contains a reference pointing to the shared part of the DWARF, and all the information that is specific to a particular instance of the inlined function, such as which register variable X is located in.
评论 #41696028 未加载
jonathrg8 个月前
&gt; We have gdb, lldb, and rr (plus about a million graphical front ends, none of which are good).<p>Strongly agree - I&#x27;ve spent a great deal of time trying to find a good GUI for gdb, but it&#x27;s all so janky compared to proper IDE debugging. As a result I only break out gdb as a last resort where printf statements don&#x27;t do the job.
评论 #41687080 未加载
评论 #41692725 未加载
评论 #41688170 未加载