Re: [PATCH] Add ending identifier for task structure parsing

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

 



On 2022/08/24 19:01, Tao Liu wrote:
>>> diff --git a/task.c b/task.c
>>> index 071c787..db2abc8 100644
>>> --- a/task.c
>>> +++ b/task.c
>>> @@ -3436,7 +3436,8 @@ parse_task_thread(int argcnt, char *arglist[], struct task_context *tc) {
>>>            while (fgets(buf, BUFSIZE, pc->tmpfile)) {
>>>                if (STREQ(buf, "  {\n"))
>>>                        randomized = TRUE;
>>> -             else if (randomized && STREQ(buf, "  }, \n"))
>>> +             else if (randomized &&
>>> +                      (STREQ(buf, "  }, \n") || STREQ(buf, "  },\n")))
>>>                        randomized = FALSE;
>>
>> Looks fine but it looks like gdb-10.2 does not print a space before "\n",
>> I think we can _replace_ the STREQ(), not add, because the current branch
>> only supports gdb-10.2.
> ?>
> 
> Did you mean remove STREQ(buf, "  }, \n") check, only to keep
> STREQ(buf, "  },\n") check?

Yes.

> I'm not 100% sure if  no-space-before-"\n"
> is the way gdb-10.2 always works. I suggest we keep the two checks,
> just in case...

ok, it's a light function and I merely checked if gdb doesn't print
a space at end of lines with a few vmcores and outputs below, and
have not looked into the gdb source.  It's ok to keep the two checks.

crash-dev> gdb p *(struct task_struct *)0xffff8f96c159c8c0 | grep ' $'
crash-dev>

Thanks,
Kazu
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/crash-utility
Contribution Guidelines: https://github.com/crash-utility/crash/wiki




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux