-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "dtc: Consider one-character strings as strings" #121
base: main
Are you sure you want to change the base?
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 <[email protected]>
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";