1 //===- llvm/CodeGen/DwarfExpression.cpp - Dwarf Debug Framework -----------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains support for writing dwarf debug info into asm files.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "DwarfExpression.h"
14 #include "DwarfCompileUnit.h"
15 #include "llvm/ADT/APInt.h"
16 #include "llvm/ADT/SmallBitVector.h"
17 #include "llvm/BinaryFormat/Dwarf.h"
18 #include "llvm/CodeGen/Register.h"
19 #include "llvm/CodeGen/TargetRegisterInfo.h"
20 #include "llvm/IR/DebugInfoMetadata.h"
21 #include "llvm/Support/ErrorHandling.h"
22 #include <algorithm>
23 #include <cassert>
24 #include <cstdint>
25 
26 using namespace llvm;
27 
28 void DwarfExpression::emitConstu(uint64_t Value) {
29   if (Value < 32)
30     emitOp(dwarf::DW_OP_lit0 + Value);
31   else if (Value == std::numeric_limits<uint64_t>::max()) {
32     // Only do this for 64-bit values as the DWARF expression stack uses
33     // target-address-size values.
34     emitOp(dwarf::DW_OP_lit0);
35     emitOp(dwarf::DW_OP_not);
36   } else {
37     emitOp(dwarf::DW_OP_constu);
38     emitUnsigned(Value);
39   }
40 }
41 
42 void DwarfExpression::addReg(int DwarfReg, const char *Comment) {
43  assert(DwarfReg >= 0 && "invalid negative dwarf register number");
44  assert((isUnknownLocation() || isRegisterLocation()) &&
45         "location description already locked down");
46  LocationKind = Register;
47  if (DwarfReg < 32) {
48    emitOp(dwarf::DW_OP_reg0 + DwarfReg, Comment);
49   } else {
50     emitOp(dwarf::DW_OP_regx, Comment);
51     emitUnsigned(DwarfReg);
52   }
53 }
54 
55 void DwarfExpression::addBReg(int DwarfReg, int Offset) {
56   assert(DwarfReg >= 0 && "invalid negative dwarf register number");
57   assert(!isRegisterLocation() && "location description already locked down");
58   if (DwarfReg < 32) {
59     emitOp(dwarf::DW_OP_breg0 + DwarfReg);
60   } else {
61     emitOp(dwarf::DW_OP_bregx);
62     emitUnsigned(DwarfReg);
63   }
64   emitSigned(Offset);
65 }
66 
67 void DwarfExpression::addFBReg(int Offset) {
68   emitOp(dwarf::DW_OP_fbreg);
69   emitSigned(Offset);
70 }
71 
72 void DwarfExpression::addOpPiece(unsigned SizeInBits, unsigned OffsetInBits) {
73   if (!SizeInBits)
74     return;
75 
76   const unsigned SizeOfByte = 8;
77   if (OffsetInBits > 0 || SizeInBits % SizeOfByte) {
78     emitOp(dwarf::DW_OP_bit_piece);
79     emitUnsigned(SizeInBits);
80     emitUnsigned(OffsetInBits);
81   } else {
82     emitOp(dwarf::DW_OP_piece);
83     unsigned ByteSize = SizeInBits / SizeOfByte;
84     emitUnsigned(ByteSize);
85   }
86   this->OffsetInBits += SizeInBits;
87 }
88 
89 void DwarfExpression::addShr(unsigned ShiftBy) {
90   emitConstu(ShiftBy);
91   emitOp(dwarf::DW_OP_shr);
92 }
93 
94 void DwarfExpression::addAnd(unsigned Mask) {
95   emitConstu(Mask);
96   emitOp(dwarf::DW_OP_and);
97 }
98 
99 bool DwarfExpression::addMachineReg(const TargetRegisterInfo &TRI,
100                                     unsigned MachineReg, unsigned MaxSize) {
101   if (!llvm::Register::isPhysicalRegister(MachineReg)) {
102     if (isFrameRegister(TRI, MachineReg)) {
103       DwarfRegs.push_back(Register::createRegister(-1, nullptr));
104       return true;
105     }
106     return false;
107   }
108 
109   int Reg = TRI.getDwarfRegNum(MachineReg, false);
110 
111   // If this is a valid register number, emit it.
112   if (Reg >= 0) {
113     DwarfRegs.push_back(Register::createRegister(Reg, nullptr));
114     return true;
115   }
116 
117   // Walk up the super-register chain until we find a valid number.
118   // For example, EAX on x86_64 is a 32-bit fragment of RAX with offset 0.
119   for (MCSuperRegIterator SR(MachineReg, &TRI); SR.isValid(); ++SR) {
120     Reg = TRI.getDwarfRegNum(*SR, false);
121     if (Reg >= 0) {
122       unsigned Idx = TRI.getSubRegIndex(*SR, MachineReg);
123       unsigned Size = TRI.getSubRegIdxSize(Idx);
124       unsigned RegOffset = TRI.getSubRegIdxOffset(Idx);
125       DwarfRegs.push_back(Register::createRegister(Reg, "super-register"));
126       // Use a DW_OP_bit_piece to describe the sub-register.
127       setSubRegisterPiece(Size, RegOffset);
128       return true;
129     }
130   }
131 
132   // Otherwise, attempt to find a covering set of sub-register numbers.
133   // For example, Q0 on ARM is a composition of D0+D1.
134   unsigned CurPos = 0;
135   // The size of the register in bits.
136   const TargetRegisterClass *RC = TRI.getMinimalPhysRegClass(MachineReg);
137   unsigned RegSize = TRI.getRegSizeInBits(*RC);
138   // Keep track of the bits in the register we already emitted, so we
139   // can avoid emitting redundant aliasing subregs. Because this is
140   // just doing a greedy scan of all subregisters, it is possible that
141   // this doesn't find a combination of subregisters that fully cover
142   // the register (even though one may exist).
143   SmallBitVector Coverage(RegSize, false);
144   for (MCSubRegIterator SR(MachineReg, &TRI); SR.isValid(); ++SR) {
145     unsigned Idx = TRI.getSubRegIndex(MachineReg, *SR);
146     unsigned Size = TRI.getSubRegIdxSize(Idx);
147     unsigned Offset = TRI.getSubRegIdxOffset(Idx);
148     Reg = TRI.getDwarfRegNum(*SR, false);
149     if (Reg < 0)
150       continue;
151 
152     // Used to build the intersection between the bits we already
153     // emitted and the bits covered by this subregister.
154     SmallBitVector CurSubReg(RegSize, false);
155     CurSubReg.set(Offset, Offset + Size);
156 
157     // If this sub-register has a DWARF number and we haven't covered
158     // its range, and its range covers the value, emit a DWARF piece for it.
159     if (Offset < MaxSize && CurSubReg.test(Coverage)) {
160       // Emit a piece for any gap in the coverage.
161       if (Offset > CurPos)
162         DwarfRegs.push_back(Register::createSubRegister(
163             -1, Offset - CurPos, "no DWARF register encoding"));
164       if (Offset == 0 && Size >= MaxSize)
165         DwarfRegs.push_back(Register::createRegister(Reg, "sub-register"));
166       else
167         DwarfRegs.push_back(Register::createSubRegister(
168             Reg, std::min<unsigned>(Size, MaxSize - Offset), "sub-register"));
169     }
170     // Mark it as emitted.
171     Coverage.set(Offset, Offset + Size);
172     CurPos = Offset + Size;
173   }
174   // Failed to find any DWARF encoding.
175   if (CurPos == 0)
176     return false;
177   // Found a partial or complete DWARF encoding.
178   if (CurPos < RegSize)
179     DwarfRegs.push_back(Register::createSubRegister(
180         -1, RegSize - CurPos, "no DWARF register encoding"));
181   return true;
182 }
183 
184 void DwarfExpression::addStackValue() {
185   if (DwarfVersion >= 4)
186     emitOp(dwarf::DW_OP_stack_value);
187 }
188 
189 void DwarfExpression::addSignedConstant(int64_t Value) {
190   assert(isImplicitLocation() || isUnknownLocation());
191   LocationKind = Implicit;
192   emitOp(dwarf::DW_OP_consts);
193   emitSigned(Value);
194 }
195 
196 void DwarfExpression::addUnsignedConstant(uint64_t Value) {
197   assert(isImplicitLocation() || isUnknownLocation());
198   LocationKind = Implicit;
199   emitConstu(Value);
200 }
201 
202 void DwarfExpression::addUnsignedConstant(const APInt &Value) {
203   assert(isImplicitLocation() || isUnknownLocation());
204   LocationKind = Implicit;
205 
206   unsigned Size = Value.getBitWidth();
207   const uint64_t *Data = Value.getRawData();
208 
209   // Chop it up into 64-bit pieces, because that's the maximum that
210   // addUnsignedConstant takes.
211   unsigned Offset = 0;
212   while (Offset < Size) {
213     addUnsignedConstant(*Data++);
214     if (Offset == 0 && Size <= 64)
215       break;
216     addStackValue();
217     addOpPiece(std::min(Size - Offset, 64u), Offset);
218     Offset += 64;
219   }
220 }
221 
222 bool DwarfExpression::addMachineRegExpression(const TargetRegisterInfo &TRI,
223                                               DIExpressionCursor &ExprCursor,
224                                               unsigned MachineReg,
225                                               unsigned FragmentOffsetInBits) {
226   auto Fragment = ExprCursor.getFragmentInfo();
227   if (!addMachineReg(TRI, MachineReg, Fragment ? Fragment->SizeInBits : ~1U)) {
228     LocationKind = Unknown;
229     return false;
230   }
231 
232   bool HasComplexExpression = false;
233   auto Op = ExprCursor.peek();
234   if (Op && Op->getOp() != dwarf::DW_OP_LLVM_fragment)
235     HasComplexExpression = true;
236 
237   // If the register can only be described by a complex expression (i.e.,
238   // multiple subregisters) it doesn't safely compose with another complex
239   // expression. For example, it is not possible to apply a DW_OP_deref
240   // operation to multiple DW_OP_pieces.
241   if (HasComplexExpression && DwarfRegs.size() > 1) {
242     DwarfRegs.clear();
243     LocationKind = Unknown;
244     return false;
245   }
246 
247   // Handle simple register locations. If we are supposed to emit
248   // a call site parameter expression and if that expression is just a register
249   // location, emit it with addBReg and offset 0, because we should emit a DWARF
250   // expression representing a value, rather than a location.
251   if (!isMemoryLocation() && !HasComplexExpression && (!isParameterValue() ||
252                                                        isEntryValue())) {
253     for (auto &Reg : DwarfRegs) {
254       if (Reg.DwarfRegNo >= 0)
255         addReg(Reg.DwarfRegNo, Reg.Comment);
256       addOpPiece(Reg.SubRegSize);
257     }
258 
259     if (isEntryValue())
260       finalizeEntryValue();
261 
262     if (isEntryValue() && !isParameterValue() && DwarfVersion >= 4)
263       emitOp(dwarf::DW_OP_stack_value);
264 
265     DwarfRegs.clear();
266     return true;
267   }
268 
269   // Don't emit locations that cannot be expressed without DW_OP_stack_value.
270   if (DwarfVersion < 4)
271     if (any_of(ExprCursor, [](DIExpression::ExprOperand Op) -> bool {
272           return Op.getOp() == dwarf::DW_OP_stack_value;
273         })) {
274       DwarfRegs.clear();
275       LocationKind = Unknown;
276       return false;
277     }
278 
279   assert(DwarfRegs.size() == 1);
280   auto Reg = DwarfRegs[0];
281   bool FBReg = isFrameRegister(TRI, MachineReg);
282   int SignedOffset = 0;
283   assert(!Reg.isSubRegister() && "full register expected");
284 
285   // Pattern-match combinations for which more efficient representations exist.
286   // [Reg, DW_OP_plus_uconst, Offset] --> [DW_OP_breg, Offset].
287   if (Op && (Op->getOp() == dwarf::DW_OP_plus_uconst)) {
288     uint64_t Offset = Op->getArg(0);
289     uint64_t IntMax = static_cast<uint64_t>(std::numeric_limits<int>::max());
290     if (Offset <= IntMax) {
291       SignedOffset = Offset;
292       ExprCursor.take();
293     }
294   }
295 
296   // [Reg, DW_OP_constu, Offset, DW_OP_plus]  --> [DW_OP_breg, Offset]
297   // [Reg, DW_OP_constu, Offset, DW_OP_minus] --> [DW_OP_breg,-Offset]
298   // If Reg is a subregister we need to mask it out before subtracting.
299   if (Op && Op->getOp() == dwarf::DW_OP_constu) {
300     uint64_t Offset = Op->getArg(0);
301     uint64_t IntMax = static_cast<uint64_t>(std::numeric_limits<int>::max());
302     auto N = ExprCursor.peekNext();
303     if (N && N->getOp() == dwarf::DW_OP_plus && Offset <= IntMax) {
304       SignedOffset = Offset;
305       ExprCursor.consume(2);
306     } else if (N && N->getOp() == dwarf::DW_OP_minus &&
307                !SubRegisterSizeInBits && Offset <= IntMax + 1) {
308       SignedOffset = -static_cast<int64_t>(Offset);
309       ExprCursor.consume(2);
310     }
311   }
312 
313   if (FBReg)
314     addFBReg(SignedOffset);
315   else
316     addBReg(Reg.DwarfRegNo, SignedOffset);
317   DwarfRegs.clear();
318   return true;
319 }
320 
321 void DwarfExpression::beginEntryValueExpression(
322     DIExpressionCursor &ExprCursor) {
323   auto Op = ExprCursor.take();
324   (void)Op;
325   assert(Op && Op->getOp() == dwarf::DW_OP_LLVM_entry_value);
326   assert(!isMemoryLocation() &&
327          "We don't support entry values of memory locations yet");
328   assert(!IsEmittingEntryValue && "Already emitting entry value?");
329   assert(Op->getArg(0) == 1 &&
330          "Can currently only emit entry values covering a single operation");
331 
332   emitOp(CU.getDwarf5OrGNULocationAtom(dwarf::DW_OP_entry_value));
333   IsEmittingEntryValue = true;
334   enableTemporaryBuffer();
335 }
336 
337 void DwarfExpression::finalizeEntryValue() {
338   assert(IsEmittingEntryValue && "Entry value not open?");
339   disableTemporaryBuffer();
340 
341   // Emit the entry value's size operand.
342   unsigned Size = getTemporaryBufferSize();
343   emitUnsigned(Size);
344 
345   // Emit the entry value's DWARF block operand.
346   commitTemporaryBuffer();
347 
348   IsEmittingEntryValue = false;
349 }
350 
351 /// Assuming a well-formed expression, match "DW_OP_deref* DW_OP_LLVM_fragment?".
352 static bool isMemoryLocation(DIExpressionCursor ExprCursor) {
353   while (ExprCursor) {
354     auto Op = ExprCursor.take();
355     switch (Op->getOp()) {
356     case dwarf::DW_OP_deref:
357     case dwarf::DW_OP_LLVM_fragment:
358       break;
359     default:
360       return false;
361     }
362   }
363   return true;
364 }
365 
366 void DwarfExpression::addExpression(DIExpressionCursor &&ExprCursor,
367                                     unsigned FragmentOffsetInBits) {
368   // If we need to mask out a subregister, do it now, unless the next
369   // operation would emit an OpPiece anyway.
370   auto N = ExprCursor.peek();
371   if (SubRegisterSizeInBits && N && (N->getOp() != dwarf::DW_OP_LLVM_fragment))
372     maskSubRegister();
373 
374   Optional<DIExpression::ExprOperand> PrevConvertOp = None;
375 
376   while (ExprCursor) {
377     auto Op = ExprCursor.take();
378     uint64_t OpNum = Op->getOp();
379 
380     if (OpNum >= dwarf::DW_OP_reg0 && OpNum <= dwarf::DW_OP_reg31) {
381       emitOp(OpNum);
382       continue;
383     } else if (OpNum >= dwarf::DW_OP_breg0 && OpNum <= dwarf::DW_OP_breg31) {
384       addBReg(OpNum - dwarf::DW_OP_breg0, Op->getArg(0));
385       continue;
386     }
387 
388     switch (OpNum) {
389     case dwarf::DW_OP_LLVM_fragment: {
390       unsigned SizeInBits = Op->getArg(1);
391       unsigned FragmentOffset = Op->getArg(0);
392       // The fragment offset must have already been adjusted by emitting an
393       // empty DW_OP_piece / DW_OP_bit_piece before we emitted the base
394       // location.
395       assert(OffsetInBits >= FragmentOffset && "fragment offset not added?");
396       assert(SizeInBits >= OffsetInBits - FragmentOffset && "size underflow");
397 
398       // If addMachineReg already emitted DW_OP_piece operations to represent
399       // a super-register by splicing together sub-registers, subtract the size
400       // of the pieces that was already emitted.
401       SizeInBits -= OffsetInBits - FragmentOffset;
402 
403       // If addMachineReg requested a DW_OP_bit_piece to stencil out a
404       // sub-register that is smaller than the current fragment's size, use it.
405       if (SubRegisterSizeInBits)
406         SizeInBits = std::min<unsigned>(SizeInBits, SubRegisterSizeInBits);
407 
408       // Emit a DW_OP_stack_value for implicit location descriptions.
409       if (isImplicitLocation())
410         addStackValue();
411 
412       // Emit the DW_OP_piece.
413       addOpPiece(SizeInBits, SubRegisterOffsetInBits);
414       setSubRegisterPiece(0, 0);
415       // Reset the location description kind.
416       LocationKind = Unknown;
417       return;
418     }
419     case dwarf::DW_OP_plus_uconst:
420       assert(!isRegisterLocation());
421       emitOp(dwarf::DW_OP_plus_uconst);
422       emitUnsigned(Op->getArg(0));
423       break;
424     case dwarf::DW_OP_plus:
425     case dwarf::DW_OP_minus:
426     case dwarf::DW_OP_mul:
427     case dwarf::DW_OP_div:
428     case dwarf::DW_OP_mod:
429     case dwarf::DW_OP_or:
430     case dwarf::DW_OP_and:
431     case dwarf::DW_OP_xor:
432     case dwarf::DW_OP_shl:
433     case dwarf::DW_OP_shr:
434     case dwarf::DW_OP_shra:
435     case dwarf::DW_OP_lit0:
436     case dwarf::DW_OP_not:
437     case dwarf::DW_OP_dup:
438       emitOp(OpNum);
439       break;
440     case dwarf::DW_OP_deref:
441       assert(!isRegisterLocation());
442       if (!isMemoryLocation() && ::isMemoryLocation(ExprCursor))
443         // Turning this into a memory location description makes the deref
444         // implicit.
445         LocationKind = Memory;
446       else
447         emitOp(dwarf::DW_OP_deref);
448       break;
449     case dwarf::DW_OP_constu:
450       assert(!isRegisterLocation());
451       emitConstu(Op->getArg(0));
452       break;
453     case dwarf::DW_OP_LLVM_convert: {
454       unsigned BitSize = Op->getArg(0);
455       dwarf::TypeKind Encoding = static_cast<dwarf::TypeKind>(Op->getArg(1));
456       if (DwarfVersion >= 5) {
457         emitOp(dwarf::DW_OP_convert);
458         // Reuse the base_type if we already have one in this CU otherwise we
459         // create a new one.
460         unsigned I = 0, E = CU.ExprRefedBaseTypes.size();
461         for (; I != E; ++I)
462           if (CU.ExprRefedBaseTypes[I].BitSize == BitSize &&
463               CU.ExprRefedBaseTypes[I].Encoding == Encoding)
464             break;
465 
466         if (I == E)
467           CU.ExprRefedBaseTypes.emplace_back(BitSize, Encoding);
468 
469         // If targeting a location-list; simply emit the index into the raw
470         // byte stream as ULEB128, DwarfDebug::emitDebugLocEntry has been
471         // fitted with means to extract it later.
472         // If targeting a inlined DW_AT_location; insert a DIEBaseTypeRef
473         // (containing the index and a resolve mechanism during emit) into the
474         // DIE value list.
475         emitBaseTypeRef(I);
476       } else {
477         if (PrevConvertOp && PrevConvertOp->getArg(0) < BitSize) {
478           if (Encoding == dwarf::DW_ATE_signed)
479             emitLegacySExt(PrevConvertOp->getArg(0));
480           else if (Encoding == dwarf::DW_ATE_unsigned)
481             emitLegacyZExt(PrevConvertOp->getArg(0));
482           PrevConvertOp = None;
483         } else {
484           PrevConvertOp = Op;
485         }
486       }
487       break;
488     }
489     case dwarf::DW_OP_stack_value:
490       LocationKind = Implicit;
491       break;
492     case dwarf::DW_OP_swap:
493       assert(!isRegisterLocation());
494       emitOp(dwarf::DW_OP_swap);
495       break;
496     case dwarf::DW_OP_xderef:
497       assert(!isRegisterLocation());
498       emitOp(dwarf::DW_OP_xderef);
499       break;
500     case dwarf::DW_OP_deref_size:
501       emitOp(dwarf::DW_OP_deref_size);
502       emitData1(Op->getArg(0));
503       break;
504     case dwarf::DW_OP_LLVM_tag_offset:
505       TagOffset = Op->getArg(0);
506       break;
507     case dwarf::DW_OP_regx:
508       emitOp(dwarf::DW_OP_regx);
509       emitUnsigned(Op->getArg(0));
510       break;
511     case dwarf::DW_OP_bregx:
512       emitOp(dwarf::DW_OP_bregx);
513       emitUnsigned(Op->getArg(0));
514       emitSigned(Op->getArg(1));
515       break;
516     default:
517       llvm_unreachable("unhandled opcode found in expression");
518     }
519   }
520 
521   if (isImplicitLocation() && !isParameterValue())
522     // Turn this into an implicit location description.
523     addStackValue();
524 }
525 
526 /// add masking operations to stencil out a subregister.
527 void DwarfExpression::maskSubRegister() {
528   assert(SubRegisterSizeInBits && "no subregister was registered");
529   if (SubRegisterOffsetInBits > 0)
530     addShr(SubRegisterOffsetInBits);
531   uint64_t Mask = (1ULL << (uint64_t)SubRegisterSizeInBits) - 1ULL;
532   addAnd(Mask);
533 }
534 
535 void DwarfExpression::finalize() {
536   assert(DwarfRegs.size() == 0 && "dwarf registers not emitted");
537   // Emit any outstanding DW_OP_piece operations to mask out subregisters.
538   if (SubRegisterSizeInBits == 0)
539     return;
540   // Don't emit a DW_OP_piece for a subregister at offset 0.
541   if (SubRegisterOffsetInBits == 0)
542     return;
543   addOpPiece(SubRegisterSizeInBits, SubRegisterOffsetInBits);
544 }
545 
546 void DwarfExpression::addFragmentOffset(const DIExpression *Expr) {
547   if (!Expr || !Expr->isFragment())
548     return;
549 
550   uint64_t FragmentOffset = Expr->getFragmentInfo()->OffsetInBits;
551   assert(FragmentOffset >= OffsetInBits &&
552          "overlapping or duplicate fragments");
553   if (FragmentOffset > OffsetInBits)
554     addOpPiece(FragmentOffset - OffsetInBits);
555   OffsetInBits = FragmentOffset;
556 }
557 
558 void DwarfExpression::emitLegacySExt(unsigned FromBits) {
559   // (((X >> (FromBits - 1)) * (~0)) << FromBits) | X
560   emitOp(dwarf::DW_OP_dup);
561   emitOp(dwarf::DW_OP_constu);
562   emitUnsigned(FromBits - 1);
563   emitOp(dwarf::DW_OP_shr);
564   emitOp(dwarf::DW_OP_lit0);
565   emitOp(dwarf::DW_OP_not);
566   emitOp(dwarf::DW_OP_mul);
567   emitOp(dwarf::DW_OP_constu);
568   emitUnsigned(FromBits);
569   emitOp(dwarf::DW_OP_shl);
570   emitOp(dwarf::DW_OP_or);
571 }
572 
573 void DwarfExpression::emitLegacyZExt(unsigned FromBits) {
574   // (X & (1 << FromBits - 1))
575   emitOp(dwarf::DW_OP_constu);
576   emitUnsigned((1ULL << FromBits) - 1);
577   emitOp(dwarf::DW_OP_and);
578 }
579 
580 void DwarfExpression::addWasmLocation(unsigned Index, int64_t Offset) {
581   assert(LocationKind == Implicit || LocationKind == Unknown);
582   LocationKind = Implicit;
583   emitOp(dwarf::DW_OP_WASM_location);
584   emitUnsigned(Index);
585   emitSigned(Offset);
586 }
587