1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

check VLIW case

If maximum_operations_per_instruction != 1, it is VLIW.
But there seems no need to support such architecture now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2018-10-21 20:01:22 +00:00
parent 281d45ab0a
commit 879b42b043

View file

@ -337,6 +337,7 @@ parse_debug_line_header(const char **pp, struct LineNumberProgramHeader *header)
if (header->version >= 4) {
/* maximum_operations_per_instruction = *(uint8_t *)p; */
if (*p != 1) return -1; /* For non-VLIW architectures, this field is 1 */
p++;
}
@ -478,13 +479,11 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
}
break;
default: {
unsigned long addr_incr;
unsigned long line_incr;
a = op - header.opcode_base;
addr_incr = (a / header.line_range) * header.minimum_instruction_length;
line_incr = header.line_base + (a % header.line_range);
addr += (unsigned int)addr_incr;
line += (unsigned int)line_incr;
uint8_t adjusted_opcode = op - header.opcode_base;
uint8_t operation_advance = adjusted_opcode / header.line_range;
/* NOTE: this code doesn't support VLIW */
addr += operation_advance * header.minimum_instruction_length;
line += header.line_base + (adjusted_opcode % header.line_range);
FILL_LINE();
}
}