本文整理汇总了C++中Outbuffer::WRITE方法的典型用法代码示例。如果您正苦于以下问题:C++ Outbuffer::WRITE方法的具体用法?C++ Outbuffer::WRITE怎么用?C++ Outbuffer::WRITE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Outbuffer
的用法示例。
在下文中一共展示了Outbuffer::WRITE方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: genDwarfEh
//.........这里部分代码省略.........
--n;
DwEhTableEntry *d = deh->index(index);
d->end = coffset;
d->lpad = coffset;
index = d->prev;
}
coffset += calccodsize(c);
}
assert(n == 0);
}
}
//printf("deh->dim = %d\n", (int)deh->dim);
#if 1
/* Build Call Site Table
* Be sure to not generate empty entries,
* and generate nested ranges reflecting the layout in the code.
*/
assert(deh->dim);
unsigned end = deh->index(0)->start;
for (unsigned i = 0; i < deh->dim; ++i)
{
DwEhTableEntry *d = deh->index(i);
if (d->start < d->end)
{
#if ELFOBJ
#define WRITE writeuLEB128
#elif MACHOBJ
#define WRITE write32
#else
assert(0);
#endif
unsigned CallSiteStart = d->start - startblock->Boffset;
cstbuf.WRITE(CallSiteStart);
unsigned CallSiteRange = d->end - d->start;
cstbuf.WRITE(CallSiteRange);
unsigned LandingPad = d->lpad ? d->lpad - startblock->Boffset : 0;
cstbuf.WRITE(LandingPad);
unsigned ActionTable = d->action;
cstbuf.writeuLEB128(ActionTable);
//printf("\t%x %x %x %x\n", CallSiteStart, CallSiteRange, LandingPad, ActionTable);
#undef WRITE
}
}
#else
/* Build Call Site Table
* Be sure to not generate empty entries,
* and generate multiple entries for one DwEhTableEntry if the latter
* is split by nested DwEhTableEntry's. This is based on the (undocumented)
* presumption that there may not
* be overlapping entries in the Call Site Table.
*/
assert(deh->dim);
unsigned end = deh->index(0)->start;
for (unsigned i = 0; i < deh->dim; ++i)
{
unsigned j = i;
do
{
DwEhTableEntry *d = deh->index(j);
//printf(" [%d] start=%x end=%x lpad=%x action=%x bcatch=%p prev=%d\n",
// j, d->start, d->end, d->lpad, d->action, d->bcatch, d->prev);
if (d->start <= end && end < d->end)
{
unsigned start = end;
unsigned dend = d->end;