kopia lustrzana https://github.com/espressif/esp-idf
core dump: modify the test according to the refactor
rodzic
d50f021a8c
commit
be71f5050d
|
@ -151,12 +151,12 @@ Name Address Size Attrs
|
||||||
.rtc.force_fast 0x3ff80000 0x0 RW
|
.rtc.force_fast 0x3ff80000 0x0 RW
|
||||||
.rtc_noinit 0x50000200 0x0 RW
|
.rtc_noinit 0x50000200 0x0 RW
|
||||||
.rtc.force_slow 0x50000200 0x0 RW
|
.rtc.force_slow 0x50000200 0x0 RW
|
||||||
.iram0.vectors 0x40080000 0x404 R XA
|
.iram0.vectors 0x40080000 0x403 R XA
|
||||||
.iram0.text 0x40080404 0xa970 RWXA
|
.iram0.text 0x40080404 0xa970 RWXA
|
||||||
.dram0.data 0x3ffb0000 0x3474 RW A
|
.dram0.data 0x3ffb0000 0x3474 RW A
|
||||||
.noinit 0x3ffb3474 0x0 RW
|
.noinit 0x3ffb3474 0x0 RW
|
||||||
.flash.rodata 0x3f400020 0x6e4c RW A
|
.flash.rodata 0x3f400020 0x6e4c RW A
|
||||||
.flash.text 0x400d0020 0x188f0 R XA
|
.flash.text 0x400d0020 0x188ef R XA
|
||||||
.iram0.text_end 0x4008ad74 0x0 RW
|
.iram0.text_end 0x4008ad74 0x0 RW
|
||||||
.dram0.heap_start 0x3ffb4cf0 0x0 RW
|
.dram0.heap_start 0x3ffb4cf0 0x0 RW
|
||||||
.coredump.tasks.data 0x3ffb6260 0x17c RW
|
.coredump.tasks.data 0x3ffb6260 0x17c RW
|
||||||
|
|
|
@ -14,28 +14,38 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import sys
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import espcoredump
|
from corefile.elf import ESPCoreDumpElfFile
|
||||||
|
from corefile.loader import ESPCoreDumpFileLoader, ESPCoreDumpLoaderError
|
||||||
except ImportError:
|
except ImportError:
|
||||||
idf_path = os.getenv('IDF_PATH')
|
idf_path = os.getenv('IDF_PATH')
|
||||||
if idf_path:
|
if idf_path:
|
||||||
sys.path.insert(0, os.path.join(idf_path, 'components', 'espcoredump'))
|
sys.path.insert(0, os.path.join(idf_path, 'components', 'espcoredump'))
|
||||||
import espcoredump
|
else:
|
||||||
|
sys.path.insert(0, '..')
|
||||||
|
from corefile.elf import ESPCoreDumpElfFile
|
||||||
|
from corefile.loader import ESPCoreDumpFileLoader, ESPCoreDumpLoaderError
|
||||||
|
|
||||||
|
|
||||||
|
class TestESPCoreDumpElfFile(unittest.TestCase):
|
||||||
|
def test_read_elf(self):
|
||||||
|
elf = ESPCoreDumpElfFile('core.elf')
|
||||||
|
assert elf.load_segments
|
||||||
|
assert elf.note_segments
|
||||||
|
|
||||||
|
|
||||||
class TestESPCoreDumpFileLoader(unittest.TestCase):
|
class TestESPCoreDumpFileLoader(unittest.TestCase):
|
||||||
def testESPCoreDumpFileLoaderWithoutB64(self):
|
def test_load_wrong_encode_core_bin(self):
|
||||||
loader = espcoredump.ESPCoreDumpFileLoader(path='coredump.b64', b64=False)
|
with self.assertRaises(ESPCoreDumpLoaderError):
|
||||||
loader.cleanup()
|
ESPCoreDumpFileLoader(path='coredump.b64', is_b64=False)
|
||||||
|
|
||||||
def test_create_corefile(self):
|
def test_create_corefile(self):
|
||||||
loader = espcoredump.ESPCoreDumpFileLoader(path='coredump.b64', b64=True)
|
loader = ESPCoreDumpFileLoader(path='coredump.b64', is_b64=True)
|
||||||
loader.create_corefile()
|
loader.create_corefile()
|
||||||
loader.cleanup()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
{ coverage debug sys \
|
{ coverage debug sys \
|
||||||
&& coverage erase \
|
&& coverage erase \
|
||||||
&& coverage run -a --source=espcoredump ../espcoredump.py --gdb-timeout-sec 5 info_corefile -m -t b64 -c coredump.b64 -s core.elf test.elf &> output \
|
&& coverage run -a --source=corefile ../espcoredump.py --gdb-timeout-sec 5 info_corefile -m -t b64 -c coredump.b64 -s core.elf test.elf &> output \
|
||||||
&& diff expected_output output \
|
&& diff expected_output output \
|
||||||
&& coverage run -a --source=espcoredump ../espcoredump.py --gdb-timeout-sec 5 info_corefile -m -t elf -c core.elf test.elf &> output2 \
|
&& coverage run -a --source=corefile ../espcoredump.py --gdb-timeout-sec 5 info_corefile -m -t elf -c core.elf test.elf &> output2 \
|
||||||
&& diff expected_output output2 \
|
&& diff expected_output output2 \
|
||||||
&& coverage run -a --source=espcoredump ./test_espcoredump.py \
|
&& coverage run -a --source=corefile ./test_espcoredump.py \
|
||||||
&& coverage report \
|
&& coverage report ../corefile/elf.py ../corefile/gdb.py ../corefile/loader.py ../corefile/xtensa.py ../espcoredump.py \
|
||||||
; } || { echo 'The test for espcoredump has failed!'; exit 1; }
|
; } || { echo 'The test for espcoredump has failed!'; exit 1; }
|
||||||
|
|
|
@ -155,7 +155,7 @@ a15 0x0 0
|
||||||
|
|
||||||
======================= ALL MEMORY REGIONS ========================
|
======================= ALL MEMORY REGIONS ========================
|
||||||
Name Address Size Attrs
|
Name Address Size Attrs
|
||||||
.text 0x400074 0x134 R XA
|
.text 0x400074 0x133 R XA
|
||||||
.eh_frame 0x4001a8 0x4 R A
|
.eh_frame 0x4001a8 0x4 R A
|
||||||
.ctors 0x4011ac 0x8 RW A
|
.ctors 0x4011ac 0x8 RW A
|
||||||
.dtors 0x4011b4 0x8 RW A
|
.dtors 0x4011b4 0x8 RW A
|
||||||
|
|
Ładowanie…
Reference in New Issue