From: Cary Coutant Date: Fri, 23 Jan 2015 21:12:29 +0000 (-0800) Subject: Update DW_LNS opcodes for two-level line tables. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc87246eb979f6eca98b508198418e9f2b98b6b0;p=thirdparty%2Fbinutils-gdb.git Update DW_LNS opcodes for two-level line tables. 2015-01-23 Cary Coutant gas/ * dwarf2dbg.c (emit_logicals): Increase max number of DW_LNS_pop_context opcodes. Change DW_LNS_set_context to DW_LNS_inlined_call. (out_debug_line): Adjust operand lengths array. --- diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index d9edc0bcb9a..506eedf55c7 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -1540,6 +1540,7 @@ emit_logicals (void) for (logical = 1; logical <= logicals_in_use; ++logical) { int line_delta; + int context_delta; struct logicals_entry *e = &logicals[logical - 1]; discriminator = 0; @@ -1558,7 +1559,7 @@ emit_logicals (void) break; caller = logicals[caller - 1].context; } - if (caller > 0 && caller <= logicals_in_use && npop < 5) + if (caller > 0 && caller <= logicals_in_use && npop < 10) { while (npop-- > 0) out_opcode (DW_LNS_pop_context); @@ -1570,16 +1571,20 @@ emit_logicals (void) context = logicals[caller - 1].context; subprog = logicals[caller - 1].subprog; } - if (context != e->context) + if (context != e->context && e->context == 0) { - context = e->context; - out_opcode (DW_LNS_set_context); - out_uleb128 (context); + context = 0; + subprog = e->subprog; + out_opcode (DW_LNS_set_subprogram); + out_uleb128 (subprog); } - if (subprog != e->subprog) + else if (context != e->context || subprog != e->subprog) { + context_delta = e->context - (logical - 1); + context = e->context; subprog = e->subprog; - out_opcode (DW_LNS_set_subprogram); + out_opcode (DW_LNS_inlined_call); + out_leb128 (context_delta); out_uleb128 (subprog); } } @@ -2120,8 +2125,8 @@ out_debug_line (segT line_seg, segT str_seg) out_byte (1); /* DW_LNS_set_isa */ if (opcode_base == DWARF2_EXPERIMENTAL_LINE_OPCODE_BASE) { - out_byte (1); /* DW_LNS_set_context/DW_LNS_set_address_from_logical */ - out_byte (1); /* DW_LNS_set_subprogram */ + out_byte (1); /* DW_LNS_set_subprogram/DW_LNS_set_address_from_logical */ + out_byte (2); /* DW_LNS_inlined_call */ out_byte (0); /* DW_LNS_pop_context */ }