Attempt to get the length of the raw bytes of a function.
(sym: str)
| 3383 | |
| 3384 | |
| 3385 | def get_function_length(sym: str) -> int: |
| 3386 | """Attempt to get the length of the raw bytes of a function.""" |
| 3387 | dis = gdb.execute(f"disassemble {sym}", to_string=True).splitlines() |
| 3388 | start_addr = int(dis[1].split()[0], 16) |
| 3389 | end_addr = int(dis[-2].split()[0], 16) |
| 3390 | return end_addr - start_addr |
| 3391 | |
| 3392 | |
| 3393 | @lru_cache() |
nothing calls this directly
no outgoing calls
no test coverage detected