pfunct: Do not reconstruct inline expansions of functions

I.e. those that point back to the inline function via
DW_AT_abstract_origin.

For instance:

 <1><34b65>: Abbrev Number: 156 (DW_TAG_subprogram)
    <34b67>   DW_AT_external    : 1
    <34b67>   DW_AT_name        : (indirect string, offset: 0x2404): tcp_enter_memory_pressure
    <34b6b>   DW_AT_decl_file   : 1
    <34b6c>   DW_AT_decl_line   : 324
    <34b6e>   DW_AT_decl_column : 6
    <34b6f>   DW_AT_prototyped  : 1
    <34b6f>   DW_AT_inline      : 1     (inlined)

  <SNIP>

   <1><37f45>: Abbrev Number: 149 (DW_TAG_subprogram)
    <37f47>   DW_AT_abstract_origin: <0x34b65>
    <37f4b>   DW_AT_low_pc      : 0x1000
    <37f53>   DW_AT_high_pc     : 0x48
    <37f5b>   DW_AT_frame_base  : 1 byte block: 9c      (DW_OP_call_frame_cfa)
    <37f5d>   DW_AT_GNU_all_call_sites: 1
    <37f5d>   DW_AT_sibling     : <0x38032>

Generated by:

  Compilation Unit @ offset 0x0:
   Length:        0x3b40b (32-bit)
   Version:       4
   Abbrev Offset: 0x0
   Pointer Size:  8
 <0><b>: Abbrev Number: 215 (DW_TAG_compile_unit)
    <d>   DW_AT_producer    : (indirect string, offset: 0xb0bc): GNU C89 8.2.1 20181215 (Red Hat 8.2.1-6) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -mindirect-branch=thunk-extern -mindirect-branch-register -mrecord-mcount -mfentry -march=x86-64 -g -O2 -std=gnu90 -p -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -falign-jumps=1 -falign-loops=1 -fno-asynchronous-unwind-tables -fno-delete-null-pointer-checks -fstack-protector-strong -fno-var-tracking-assignments -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fstack-check=no -fconserve-stack --param allow-store-data-races=0
    <11>   DW_AT_language    : 1        (ANSI C)
    <12>   DW_AT_name        : (indirect string, offset: 0x10daa): /home/acme/git/linux/net/ipv4/tcp.c
    <16>   DW_AT_comp_dir    : (indirect string, offset: 0x1d8c5): /home/acme/git/build/v5.0+

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2019-04-04 21:22:42 -03:00
parent ea83b780ec
commit 163b873f81
1 changed files with 3 additions and 0 deletions

View File

@ -355,6 +355,9 @@ static void function__show(struct function *func, struct cu *cu)
{
struct tag *tag = function__tag(func);
if (func->abstract_origin)
return;
if (expand_types)
function__emit_type_definitions(func, cu, stdout);
tag__fprintf(tag, cu, &conf, stdout);