[crac] RFR: Fix: arguments supplied to restore are split with whitespace
YizhePKU
duke at openjdk.org
Tue Aug 29 11:47:08 UTC 2023
On Thu, 17 Aug 2023 12:43:26 GMT, YizhePKU <duke at openjdk.org> wrote:
>> src/hotspot/share/runtime/arguments.hpp line 151:
>>
>>> 149: class ScopedVMInitArgs;
>>> 150:
>>> 151: // Arguments passed from JavaMain via the property CRaCJavaMainArgs
>>
>> Duplicating structure definition and relying on the same ABI is too fragile in my opinion. I understand that the options for passing across libraries is limited; escaped sequence as the actual value would be a better choice, though. I was also considering the `extraInfo` with a null-separated and null-null-terminated data, but individual argument can be empty so this wouldn't fly.
>
>> I was also considering the `extraInfo` with a null-separated and null-null-terminated data, but individual argument can be empty so this wouldn't fly.
>
> Actually, that might just work, as long as we pass `argc` along. I'll give it a try.
> Duplicating structure definition and relying on the same ABI is too fragile in my opinion.
If you mean `JavaMainArgs` could change its content without us noticing, then maybe it's better that we define our own struct. Otherwise, duplicating structure definition is actually the same thing as defining it in a header file and then including the header twice, since `#include` in C++ is literally copy-and-paste.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/101#discussion_r1297414439
More information about the crac-dev
mailing list