From: Cupertino Miranda Date: Thu, 30 Nov 2023 18:13:34 +0000 (+0000) Subject: btf: print string offset in comment X-Git-Tag: basepoints/gcc-15~3129 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a5bb8bc1c562ba4d6e97f1979de6b8ac566f04f;p=thirdparty%2Fgcc.git btf: print string offset in comment When using -dA, this function was only printing as comment btf_string or btf_aux_string. This patch changes the comment to also include the position of the string within the section in hexadecimal format. gcc/ChangeLog: * btfout.cc (output_btf_strs): Changed. --- diff --git a/gcc/btfout.cc b/gcc/btfout.cc index bf3183d09118..669d357dfd67 100644 --- a/gcc/btfout.cc +++ b/gcc/btfout.cc @@ -1105,17 +1105,20 @@ static void output_btf_strs (ctf_container_ref ctfc) { ctf_string_t * ctf_string = ctfc->ctfc_strtable.ctstab_head; + static int str_pos = 0; while (ctf_string) { - dw2_asm_output_nstring (ctf_string->cts_str, -1, "btf_string"); + dw2_asm_output_nstring (ctf_string->cts_str, -1, "btf_string, str_pos = 0x%x", str_pos); + str_pos += strlen(ctf_string->cts_str) + 1; ctf_string = ctf_string->cts_next; } ctf_string = ctfc->ctfc_aux_strtable.ctstab_head; while (ctf_string) { - dw2_asm_output_nstring (ctf_string->cts_str, -1, "btf_aux_string"); + dw2_asm_output_nstring (ctf_string->cts_str, -1, "btf_aux_string, str_pos = 0x%x", str_pos); + str_pos += strlen(ctf_string->cts_str) + 1; ctf_string = ctf_string->cts_next; } }