]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
binman: Expand the error message for breaching a section
authorSimon Glass <sjg@chromium.org>
Mon, 26 Oct 2020 23:40:05 +0000 (17:40 -0600)
committerSimon Glass <sjg@chromium.org>
Thu, 29 Oct 2020 20:42:59 +0000 (14:42 -0600)
Add in a few more details to this error message to make it easier to see
what is going on.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/binman/etype/section.py
tools/binman/ftest.py

index 327750461ebb8b311f5654a04e8cc5197fd03dd0..a3e37c33c1b9aae8a3f654047ee95c09cb9de390 100644 (file)
@@ -220,10 +220,12 @@ class Entry_section(Entry):
             if (entry.offset < self._skip_at_start or
                     entry.offset + entry.size > self._skip_at_start +
                     self.size):
-                entry.Raise("Offset %#x (%d) is outside the section starting "
-                            "at %#x (%d)" %
-                            (entry.offset, entry.offset, self._skip_at_start,
-                             self._skip_at_start))
+                entry.Raise('Offset %#x (%d) size %#x (%d) is outside the '
+                            "section '%s' starting at %#x (%d) "
+                            'of size %#x (%d)' %
+                            (entry.offset, entry.offset, entry.size, entry.size,
+                             self._node.path, self._skip_at_start,
+                             self._skip_at_start, self.size, self.size))
             if entry.offset < offset and entry.size:
                 entry.Raise("Offset %#x (%d) overlaps with previous entry '%s' "
                             "ending at %#x (%d)" %
index adc16038d9919b6c851bda760de6a2ae79b7cdaf..4f7e22612cc7b627d127f3486033561346d6aed3 100644 (file)
@@ -970,8 +970,9 @@ class TestFunctional(unittest.TestCase):
         """Test that the end-at-4gb property checks for offset boundaries"""
         with self.assertRaises(ValueError) as e:
             self._DoTestFile('028_pack_4gb_outside.dts')
-        self.assertIn("Node '/binman/u-boot': Offset 0x0 (0) is outside "
-                      "the section starting at 0xffffffe0 (4294967264)",
+        self.assertIn("Node '/binman/u-boot': Offset 0x0 (0) size 0x4 (4) "
+                      "is outside the section '/binman' starting at "
+                      '0xffffffe0 (4294967264) of size 0x20 (32)',
                       str(e.exception))
 
     def testPackX86Rom(self):