Re: Encountered error while encoding BTF due to Unsupported DW_TAG_unspecified_type(0x3b)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Em Tue, Oct 04, 2022 at 03:07:57PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Oct 04, 2022 at 10:25:31AM -0300, Arnaldo Carvalho de Melo escreveu:
> > On October 4, 2022 9:33:05 AM GMT-03:00, Nick Clifton <nickc@xxxxxxxxxx> wrote:
> > >Hi Arnaldo,
> > >
> > >>>   <0><c>: Abbrev Number: 3 (DW_TAG_unspecified_type) <--- the problematic TAG
> > >
> > >>>   <1><29>: Abbrev Number: 2 (DW_TAG_subprogram)
> > >>>      <2a>   DW_AT_name        : (indirect string, offset: 0x2e): entry_ibpb
> > >>>      <2e>   DW_AT_type        : <0xc>
> > >
> > >If it helps the tag is used to tell consumers like GDB that the return
> > >type of specific functions (eg entry_ibpb in the above example) is unknown.
>  
> > Sure helps, thanks!
>  
> > I noticed this is for assembly source code, I'll add it as a special
> > "type" and probably for BTF mask it to void.
> 
> s/mask/map/g

I just committed the patch below, now to support
DW_TAG_unspecified_type...

- Arnaldo

commit 79d9a783ea74797aa4304009e0cf1bdb9235fcf4
Author: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Date:   Tue Oct 4 18:09:33 2022 -0300

    pahole: Support '--lang/--lang_exclude=asm'
    
    It is disjoint from the other languages and then the first simple
    implementation of language inclusion/exclusion didn't support it, add
    an special case to test against 0x8001 (DW_LANG_Mips_Assembler) to cover
    that.
    
    This is needed as recently compilers started to add DWARF constructs to
    represent asm CUs that broke pahole as it didn't support
    DW_TAG_unspecified_type as a "type", so add it in case in the future we
    want to exclude such CUs.
    
    The DW_TAG_unspecified_type tag is going to be supported in the next
    csets tho.
    
    We also may want this to exclude new tags that aren't supported in BTF,
    etc.
    
    Cc: Martin Liška <mliska@xxxxxxx>
    Cc: Nick Clifton <nickc@xxxxxxxxxx>
    Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

diff --git a/dwarves.c b/dwarves.c
index 9589747f49f8f3a7..0405592ce0a540a5 100644
--- a/dwarves.c
+++ b/dwarves.c
@@ -2240,6 +2240,9 @@ int lang__str2int(const char *lang)
 	[DW_LANG_UPC]		 = "upc",
 	};
 
+	if (strcasecmp(lang, "asm") == 0)
+		return DW_LANG_Mips_Assembler;
+
 	// c89 is the first, bliss is the last, see /usr/include/dwarf.h
 	for (int id = DW_LANG_C89; id <= DW_LANG_BLISS; ++id)
 		if (languages[id] && strcasecmp(lang, languages[id]) == 0)
diff --git a/man-pages/pahole.1 b/man-pages/pahole.1
index d752ccbeb297d9d7..45a21af500d94772 100644
--- a/man-pages/pahole.1
+++ b/man-pages/pahole.1
@@ -378,7 +378,7 @@ Only process compilation units built from source code written in the specified l
 
 Supported languages:
 
-  ada83, ada95, bliss, c, c89, c99, c11, c++, c++03, c++11, c++14, cobol74,
+  ada83, ada95, asm, bliss, c, c89, c99, c11, c++, c++03, c++11, c++14, cobol74,
   cobol85, d, dylan, fortran77, fortran90, fortran95, fortran03, fortran08,
   go, haskell, java, julia, modula2, modula3, objc, objc++, ocaml, opencl,
   pascal83, pli, python, renderscript, rust, swift, upc



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux