File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,7 @@ class Esp8266ExceptionDecoder(
37
37
ADDR_MAX = 0x40300000
38
38
39
39
STATE_DEFAULT = 0
40
- STATE_READ_EXCEPTION = 1
41
- STATE_IN_STACK = 2
40
+ STATE_IN_STACK = 1
42
41
43
42
EXCEPTION_MARKER = "Exception ("
44
43
@@ -157,6 +156,9 @@ def rx(self, text):
157
156
self .buffer = ""
158
157
last = idx + 1
159
158
159
+ if line [- 1 ] == "\r " :
160
+ line = line [:- 1 ]
161
+
160
162
extra = self .process_line (line )
161
163
self .previous_line = line
162
164
if extra is not None :
@@ -177,19 +179,18 @@ def is_addr_ok(self, hex_addr):
177
179
178
180
def process_line (self , line ): # pylint: disable=too-many-return-statements
179
181
if self .state == self .STATE_DEFAULT :
182
+ extra = None
180
183
if self .previous_line .startswith (self .EXCEPTION_MARKER ):
181
184
two_lines = (
182
185
self .previous_line [len (self .EXCEPTION_MARKER ) :] + "\n " + line
183
186
)
184
187
match = self .exception_re .match (two_lines )
185
188
if match is not None :
186
- self .advance_state ()
187
- return self .process_exception_match (match )
188
- return None
189
- elif self .state == self .STATE_READ_EXCEPTION :
189
+ extra = self .process_exception_match (match )
190
+
190
191
if line == ">>>stack>>>" :
191
192
self .advance_state ()
192
- return None
193
+ return extra
193
194
elif self .state == self .STATE_IN_STACK :
194
195
if line == "<<<stack<<<" :
195
196
self .state = self .STATE_DEFAULT
You can’t perform that action at this time.
0 commit comments