From b599f2fcc734e2183016a340d4f6fc2891d8e41f Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Thu, 19 Aug 2021 13:12:01 +0000 Subject: pkg/report: make opcode decompilation more intelligent Skip Code: lines that refer to user-space. Skip code listings where the trapping instruction is an intentionally invalid one (this happens in WARNINGs and most of BUG reports). Decompilation of such code fragments provides no value to the user. Add new tests and update the existing ones. Closes #2709 and #2710. --- pkg/report/testdata/linux/decompile/arm64/0.out | 7 ------- pkg/report/testdata/linux/decompile/arm64/1.out | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'pkg/report/testdata/linux/decompile/arm64') diff --git a/pkg/report/testdata/linux/decompile/arm64/0.out b/pkg/report/testdata/linux/decompile/arm64/0.out index 2b6406f60..654ec9506 100644 --- a/pkg/report/testdata/linux/decompile/arm64/0.out +++ b/pkg/report/testdata/linux/decompile/arm64/0.out @@ -40,10 +40,3 @@ Call trace: work_pending+0xc/0x3d4 Code: cb000260 d34cfc00 97fcf6fe 35fffc20 (d4210000) ---[ end trace 9cab793efd001cad ]--- ----------------- -Code disassembly (best guess): - 0: cb000260 sub x0, x19, x0 - 4: d34cfc00 lsr x0, x0, #12 - 8: 97fcf6fe bl 0xfffffffffff3dc00 - c: 35fffc20 cbnz w0, 0xffffffffffffff90 - 10: d4210000 brk #0x800 <-- trapping instruction diff --git a/pkg/report/testdata/linux/decompile/arm64/1.out b/pkg/report/testdata/linux/decompile/arm64/1.out index c07a4756b..09ea024f2 100644 --- a/pkg/report/testdata/linux/decompile/arm64/1.out +++ b/pkg/report/testdata/linux/decompile/arm64/1.out @@ -53,4 +53,4 @@ Code disassembly (best guess): 4: f2df7fe1 movk x1, #0xfbff, lsl #32 8: f2ffffe1 movk x1, #0xffff, lsl #48 c: 8b010273 add x19, x19, x1 - 10: 39000274 strb w20, [x19] <-- trapping instruction +* 10: 39000274 strb w20, [x19] <-- trapping instruction -- cgit mrf-deployment