]> git.baikalelectronics.ru Git - uboot.git/commitdiff
dtoc: Improve internal error for Refresh()
authorSimon Glass <sjg@chromium.org>
Sun, 21 Mar 2021 05:24:34 +0000 (18:24 +1300)
committerSimon Glass <sjg@chromium.org>
Sat, 27 Mar 2021 03:26:48 +0000 (16:26 +1300)
Add the node name too so it is easy to see which node failed.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/dtoc/fdt.py
tools/dtoc/test_fdt.py

index 25ce5136ebff5871a2e106e45339d2ce7c1b363e..f0d1384ccc39932249b757907fa7eed890b446dc 100644 (file)
@@ -339,8 +339,8 @@ class Node:
             p = fdt_obj.get_property_by_offset(poffset)
             prop = self.props.get(p.name)
             if not prop:
-                raise ValueError("Internal error, property '%s' missing, "
-                                 'offset %d' % (p.name, poffset))
+                raise ValueError("Internal error, node '%s' property '%s' missing, "
+                                 'offset %d' % (self.path, p.name, poffset))
             prop.RefreshOffset(poffset)
             poffset = fdt_obj.next_property_offset(poffset, QUIET_NOTFOUND)
 
index 1c3a8a2ab1ea192d510fc975d07a10b220ce7387..72095b05434d73480b43afa75148f40e206d0ec5 100755 (executable)
@@ -209,7 +209,7 @@ class TestNode(unittest.TestCase):
         del self.node.props['notstring']
         with self.assertRaises(ValueError) as e:
             self.dtb.Refresh()
-        self.assertIn("Internal error, property 'notstring' missing, offset ",
+        self.assertIn("Internal error, node '/spl-test' property 'notstring' missing, offset ",
                       str(e.exception))
 
     def testLookupPhandle(self):