Skip to content

Commit

Permalink
fix: Catch exception when the ELF file is modified
Browse files Browse the repository at this point in the history
This commit fixes the issue where the ELF file is modified while the
panic decoder is running. The decoder now catches the exception and
prints a error message.

Closes #1
  • Loading branch information
Dzarda7 committed Aug 5, 2024
1 parent 1ca1b96 commit 112cf24
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions esp_idf_panic_decoder/pc_address_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,7 @@ def lookup_pc_address(self, pc_addr: str, is_rom: bool = False) -> Optional[str]
return decoded if not is_rom else decoded.replace('at ??:?', 'in ROM')
except OSError as err:
red_print(f'{" ".join(cmd)}: {err}')
except subprocess.CalledProcessError as err:
red_print(f'{" ".join(cmd)}: {err}')
red_print('ELF file is missing or has changed, the build folder was probably modified.')
return None

0 comments on commit 112cf24

Please sign in to comment.