mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Fix stack trace decode for latest platformio (#830)
This commit is contained in:
		| @@ -101,12 +101,14 @@ def run_idedata(config): | ||||
|     args = ['-t', 'idedata'] | ||||
|     stdout = run_platformio_cli_run(config, False, *args, capture_stdout=True) | ||||
|     stdout = decode_text(stdout) | ||||
|     match = re.search(r'{.*}', stdout) | ||||
|     match = re.search(r'{\s*".*}', stdout) | ||||
|     if match is None: | ||||
|         _LOGGER.debug("Could not match IDEData for %s", stdout) | ||||
|         return IDEData(None) | ||||
|     try: | ||||
|         return IDEData(json.loads(match.group())) | ||||
|     except ValueError: | ||||
|         _LOGGER.debug("Could not load IDEData for %s", stdout, exc_info=1) | ||||
|         return IDEData(None) | ||||
|  | ||||
|  | ||||
| @@ -165,11 +167,13 @@ ESP8266_EXCEPTION_CODES = { | ||||
| def _decode_pc(config, addr): | ||||
|     idedata = get_idedata(config) | ||||
|     if not idedata.addr2line_path or not idedata.firmware_elf_path: | ||||
|         _LOGGER.debug("decode_pc no addr2line") | ||||
|         return | ||||
|     command = [idedata.addr2line_path, '-pfiaC', '-e', idedata.firmware_elf_path, addr] | ||||
|     try: | ||||
|         translation = subprocess.check_output(command).strip() | ||||
|         translation = decode_text(subprocess.check_output(command)).strip() | ||||
|     except Exception:  # pylint: disable=broad-except | ||||
|         _LOGGER.debug("Caught exception for command %s", command, exc_info=1) | ||||
|         return | ||||
|  | ||||
|     if "?? ??:0" in translation: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user