Chris's Wiki :: blog/linux/GdbGetpeername Commentshttps://utcc.utoronto.ca/~cks/space/blog/linux/GdbGetpeername?atomcommentsDWiki2011-04-02T11:59:32ZRecent comments in Chris's Wiki :: blog/linux/GdbGetpeername.From 86.53.68.233 on /blog/linux/GdbGetpeernametag:CSpace:blog/linux/GdbGetpeername:9d42787ef0157c6cc7619fdfcab6e5f19455f62eFrom 86.53.68.233<div class="wikitext"><p>Bwaha.</p>
<p>-- Alan the Evil Hack-er.</p>
<p>I consider it non-obvious in two ways. Most of the time, you just want to inspect individual variables; it's not obvious that GDB includes 1) an expression parser; 2) the ability to call arbitrary functions in a suspended process. And then there's the malloc() hack, which is exactly what I was thinking of. If I was less evil, I might have mentioned it in passing.</p>
<p>Personally, I believe I've tended to write it as</p>
<pre>
set $1 = malloc(...)
</pre>
<p>but it turns out that doesn't work if it's your first expression. I guess you're expected to use instead</p>
<pre>
set $a = malloc(...)
</pre>
</div>2011-04-02T11:59:32Z