Some collected tracepoints may have missing the filename field. So before
trying to filter the frames by filename test if it is present.

Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com>
---
 scripts/osv/trace.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/osv/trace.py b/scripts/osv/trace.py
index fb14c4fe..1b979215 100644
--- a/scripts/osv/trace.py
+++ b/scripts/osv/trace.py
@@ -33,7 +33,7 @@ class BacktraceFormatter:
 
         frames = list(debug.resolve_all(self.resolver, (x - 1 for x in 
backtrace if x)))
 
-        while frames[0].name and (frames[0].name.startswith("tracepoint") or 
frames[0].filename.endswith("trace.hh")):
+        while frames[0].name and (frames[0].name.startswith("tracepoint") or 
(frames[0].filename and frames[0].filename.endswith("trace.hh"))):
             frames.pop(0)
 
         if self.multiline:
-- 
2.35.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/20230404024308.169022-3-jwkozaczuk%40gmail.com.

Reply via email to