struct itemplate: add insns.xda line number to the structure

Add the line number from insns.xda to struct itemplate. NASM itself
doesn't need this information, but it makes debugging matching *much*
easier; it is worth a few more bytes.

In theory it could be conditionalized on --enable-debug, but it is
probably not worth it.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin (Intel) 2026-03-03 09:55:27 -08:00
parent 99898edfc1
commit fbacd59cce
2 changed files with 2 additions and 1 deletions

View file

@ -20,6 +20,7 @@ struct itemplate {
decoflags_t deco[MAX_OPERANDS]; /* bit flags for operand decorators */
const uint8_t *code; /* the code it assembles to */
uint32_t iflag_idx; /* some flags referenced by index */
unsigned int xdaline; /* line # in insns.xda (for debug) */
};
/* Use this helper to test instruction template flags */

View file

@ -888,7 +888,7 @@ sub format_insn($$$$) {
$flagsindex = insns_flag_index(\%flags);
die "$fname:$line: $opcode: error in flags $flags\n" unless (defined($flagsindex));
return ("{I_$opcode, $nops, {$operands}, $decorators, \@\@CODES-$codes\@\@, $flagsindex},", $nd);
return ("{I_$opcode, $nops, {$operands}, $decorators, \@\@CODES-$codes\@\@, $flagsindex, $line},", $nd);
}
#