[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 0/2] semihosting: clean up and add --semihost
From: |
Liviu Ionescu |
Subject: |
Re: [Qemu-devel] [PATCH v5 0/2] semihosting: clean up and add --semihosting-config arg |
Date: |
Sat, 20 Jun 2015 23:14:10 +0300 |
> On 20 Jun 2015, at 22:49, Peter Maydell <address@hidden> wrote:
>
>> as you can see, it tries to use the kernel name as command line, which
>> exceeds the application small buffer size.
>
> It only does that if you didn't specify the arguments the new
> way (at least that is the intention).
what if I do not need to specify any arguments at all, and I want the
application to know this?
> We need to maintain the
> old behaviour for back compatibility.
...
> On 05 Jun 2015, at 18:23, Peter Maydell <address@hidden> wrote:
>
>> + output_size = strlen(semihosting_get_cmdline()) + 1;
>
> It looks like semihosting_get_cmdline() can return NULL,
> in which case this will blow up, I think.
if back compatibility for preserving the bugs was the goal, then it was
reached, the new version also crashes in cases where there are no args and no
kernel (for example when the image is loaded via GDB).
> On 05 Jun 2015, at 23:09, Leon Alrae <address@hidden> wrote:
>
> As far as I can tell existing
> implementation may also blow up if kernel_filename is NULL, so we retain
> the same behaviour.
whatever your views regarding compatibility are, here the correct approach is
to check the semihosting_get_cmdline() result for NULL, and make
TARGET_SYS_GET_CMDLINE return -1 or an empty string.
regards,
Liviu