Dne Čt 7. června 2012 14:07:59 Petr Tesarik napsal(a): > Dne Čt 7. června 2012 03:58:16 qiaonuohan napsal(a): > > At 2012-6-6 21:44, Petr Tesarik wrote: > > > crash> list task_struct.tasks -s task_struct.tasks -h 0xeede04f0+432 > > > eede04f0 > > > > > > tasks = { > > > > > > next = 0xd79d6f20, > > > prev = 0xd55e6220 > > > > > > } > > > > > > d79d6d70 > > > > > > tasks = { > > > > > > next = 0xc32c5320, > > > prev = 0xeede06a0 > > > > > > } > > > > > > ... > > > > > > Note that the first element in the list (the one which contains the > > > starting list_head) is included. > > > > > > Based on the above, I'm afraid don't quite get the intended goal of > > > your patch. > > > > Hello Petr and Dave, > > > > I misunderstood the usage. > > > > What I really think is changing the start address from the address of > > list_head to the address of the structure where list_head is embedded. > > > > In many cases I use list command, I found I can get the address of the > > structure where the list_head embedded directly. And I can get the > > offset of list_head by -o option. So the offset, say "+432" in your > > example, can be omitted. What do you think of such change? > > That was also my suggestion. It would even turn "list -h" into something > useful. ;-) > > Here's my attempt at a patch. Plus the documentation part. Petr
From: Petr Tesarik <ptesarik@xxxxxxx> Subject: Document the "list -h" parameter Mention the "-h" parameter in the output of "help list". Signed-off-by: Petr Tesarik <ptesarik@xxxxxxx> --- help.c | 3 +++ 1 file changed, 3 insertions(+) --- a/help.c +++ b/help.c @@ -4431,6 +4431,9 @@ char *help__list[] = { " is pre-pended or not:", " ", " start The address of the first structure in the list.", +" -h start The address of the first structure in the list. The \"next\"", +" pointer is treated as a pointer to the embedded list_head,", +" NOT to the containing structure.", " -H start The address of the list_head structure, typically expressed", " symbolically, but also can be an expression evaluating to the", " address of the starting list_head structure.",
-- Crash-utility mailing list Crash-utility@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/crash-utility