lkml.org 
[lkml]   [2023]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 5/9] objtool: Add verbose option for disassembling affected functions
On Wed, Apr 12, 2023 at 12:03:20PM -0700, Josh Poimboeuf wrote:
> + objdump_str = "%sobjdump -wdr %s | gawk -M -v _funcs='%s' '"
> + "BEGIN { split(_funcs, funcs); }"
> + "/^$/ { func_match = 0; }"
> + "/<.*>:/ { "
> + "f = gensub(/.*<(.*)>:/, \"\\\\1\", 1);"
> + "for (i in funcs) {"
> + "if (funcs[i] == f) {"
> + "func_match = 1;"
> + "base = strtonum(\"0x\" $1);"
> + "break;"
> + "}"
> + "}"
> + "}"
> + "{"
> + "if (func_match) {"
> + "addr = strtonum(\"0x\" $1);"
> + "printf(\"%%04x \", addr - base);"
> + "print;"
> + "}"
> + "}' 1>&2";

Do we want to have scripts/objdump-func.awk and use that to avoid the
duplication and eventual divergence of these awk thingies?

\
 
 \ /
  Last update: 2023-04-13 10:11    [W:0.599 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site