qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 08/10] linux-user: factor out reading of /proc/self/maps


From: Alex Bennée
Subject: Re: [PATCH v2 08/10] linux-user: factor out reading of /proc/self/maps
Date: Fri, 03 Apr 2020 13:35:23 +0100
User-agent: mu4e 1.3.10; emacs 28.0.50

Richard Henderson <address@hidden> writes:

> On 4/1/20 2:47 AM, Alex Bennée wrote:
>> +typedef struct {
>> +    uint64_t start;
>> +    uint64_t end;
> ...
>> +                errors  = qemu_strtoul(fields[0], &end, 16, &e->start);
>> +                errors += qemu_strtoul(end + 1, NULL, 16, &e->end);
>
> uint64_t vs unsigned long -- you want qemu_strtou64.
>
>> +                errors += qemu_strtoul(fields[2], NULL, 16, &e->offset);
>
> Likewise.

Actually I went to using unsigned longs in the structure as that is the
natural size for host map info.

>
>> +                /* A bit ugly as strsplit doesn't skip multiple separators 
>> */
>> +                if (g_strv_length(fields) > 6) {
>> +                    e->path = g_strdup(fields[g_strv_length(fields) - 1]);
>> +                }
>
> And if the path contains spaces?

interesting bugs I guess - I'll see if I can do a cleaner pass.
>
>
> r~


-- 
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]