Parse event_bytes data into system calls for easier processing. This assumes the program under inspection doesn't print any non-utf8 strings which would mix into the strace output.
(self)
| 34 | stderr: bytes |
| 35 | |
| 36 | def events(self): |
| 37 | """Parse event_bytes data into system calls for easier processing. |
| 38 | |
| 39 | This assumes the program under inspection doesn't print any non-utf8 |
| 40 | strings which would mix into the strace output.""" |
| 41 | decoded_events = self.event_bytes.decode('utf-8', 'surrogateescape') |
| 42 | matches = [ |
| 43 | _syscall_regex.match(event) |
| 44 | for event in decoded_events.splitlines() |
| 45 | ] |
| 46 | return [ |
| 47 | StraceEvent(match["syscall"], |
| 48 | [arg.strip() for arg in (match["args"].split(","))], |
| 49 | match["returncode"]) for match in matches if match |
| 50 | ] |
| 51 | |
| 52 | def sections(self): |
| 53 | """Find all "MARK <X>" writes and use them to make groups of events. |
no test coverage detected