Revert "dtc: Consider one-character strings as strings"#121
Revert "dtc: Consider one-character strings as strings"#121flto wants to merge 1 commit intodgibson:mainfrom
Conversation
This reverts commit 9d7888c. This commit broke decompilation in certain cases. For example: regulator-min-microvolt = <0x00324b00>; is now decompiled (incorrectly) as: regulator-min-microvolt = "\02K"; Signed-off-by: Jonathan Marek <jonathan@marek.ca>
|
Decompilation of dtbs, like most decompilations, is an approximate process. Although we can guarantee we get something that will recompile into the same dtb, we can't guarantee we'll have the same dts as the original: the type information that's implied in the dts is simply lost along the way. In the dts format The function affected here, So in order to make a change here, it's not sufficient to say it's "wrong" for some examples, you need to make the case that the cases it now gets "right" (i.e. more readable / less surprising) are more common or more important than the cases it now gets "wrong" (less readable / more surprising). |
|
the problem is it doesn't recompile to the same bytes - compiling the |
Oh, right, good point. But, reverting this patch is only papering over the problem. I'm pretty sure there exist other examples that will trigger the same problem even with the revert in place. The real bug here is in I guess we need to have |
|
if you don't want the output to be ugly, you should split the string for |
We still need to fix
Yes, we already use hex escapes for most characters. |
|
Oh dear. I had a closer look into this and it's a real can of worms.
|
This reverts commit 9d7888c.
This commit broke decompilation in certain cases. For example:
regulator-min-microvolt = <0x00324b00>;
is now decompiled (incorrectly) as:
regulator-min-microvolt = "\02K";