How do I traverse double/single linked-list and print few desired fields of the structure that is p

Probably this question has been asked before couple of times and replied.
But I dont know/remember the answer.
I dont want to use LIST_ENTRY as of now.

IS there any extension in windbg to do this currently?

Or the only option is to write a windbg extension? If so, does anyone know
of existing windbg extension to do that?

Thanks,
-Praveen

Try looking at the examples provided with the !list command in the debugger
docs. The syntax is impressively daunting, but it does work (though, in
reality, it might be easier and more useful to just write an extension).

-scott

Scott Noone
Software Engineer
OSR Open Systems Resources, Inc.
http://www.osronline.com

“Praveen Kumar Amritaluru” wrote in message
news:xxxxx@windbg…
> Probably this question has been asked before couple of times and replied.
> But I dont know/remember the answer.
> I dont want to use LIST_ENTRY as of now.
>
> IS there any extension in windbg to do this currently?
>
> Or the only option is to write a windbg extension? If so, does anyone know
> of existing windbg extension to do that?
>
> Thanks,
> -Praveen
>
>

I would concur on this one: it works, but, assuming you know how to
write an extension, it will be easier and probably more useful to just
write one.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Scott Noone
Sent: Wednesday, June 27, 2007 10:24
To: Kernel Debugging Interest List
Subject: Re:[windbg] How do I traverse double/single linked-list and
print few desired fields of the structure that is part of linked list
using windbg?

Try looking at the examples provided with the !list command in the
debugger
docs. The syntax is impressively daunting, but it does work (though, in
reality, it might be easier and more useful to just write an extension).

-scott

Scott Noone
Software Engineer
OSR Open Systems Resources, Inc.
http://www.osronline.com

“Praveen Kumar Amritaluru” wrote in message
news:xxxxx@windbg…
> Probably this question has been asked before couple of times and
replied.
> But I dont know/remember the answer.
> I dont want to use LIST_ENTRY as of now.
>
> IS there any extension in windbg to do this currently?
>
> Or the only option is to write a windbg extension? If so, does anyone
know
> of existing windbg extension to do that?
>
> Thanks,
> -Praveen
>
>


You are currently subscribed to windbg as: xxxxx@evitechnology.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Praveen Kumar Amritaluru wrote:

Probably this question has been asked before couple of times and replied.
But I dont know/remember the answer.
I dont want to use LIST_ENTRY as of now.

IS there any extension in windbg to do this currently?

Or the only option is to write a windbg extension? If so, does anyone know
of existing windbg extension to do that?

The answer to this seems pretty obvious. If you write your own custom
data structure, then you will surely need your own custom windbg
extension to traverse it.

That’s one darned good reason to use LIST_ENTRY instead of rolling your own.

One of my favorite features of the GNU gdb debugger is that you can call
named routines in the module under test. I often include debug
functions that are never called in the code, specifically for use within
gdb. It’s a lot easier than writing a formal debugger extension.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

I took the time to try and break down the parameters to !list and wrote
about it last year. Read
http://blogs.msdn.com/doronh/archive/2006/08/10/693769.aspx if you want
to see what I did.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, June 27, 2007 9:58 AM
To: Kernel Debugging Interest List
Subject: Re: [windbg] How do I traverse double/single linked-list and
print few desired fields of the structure that is part of linked list
using windbg?

Praveen Kumar Amritaluru wrote:

Probably this question has been asked before couple of times and
replied.
But I dont know/remember the answer.
I dont want to use LIST_ENTRY as of now.

IS there any extension in windbg to do this currently?

Or the only option is to write a windbg extension? If so, does anyone
know
of existing windbg extension to do that?

The answer to this seems pretty obvious. If you write your own custom
data structure, then you will surely need your own custom windbg
extension to traverse it.

That’s one darned good reason to use LIST_ENTRY instead of rolling your
own.

One of my favorite features of the GNU gdb debugger is that you can call
named routines in the module under test. I often include debug
functions that are never called in the code, specifically for use within
gdb. It’s a lot easier than writing a formal debugger extension.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


You are currently subscribed to windbg as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi,

I took a look at your article. I find it very useful. Now I am changing my code to use LIST_ENTRY.

typedef struct _MY_DATA {
LIST_ENTRY ListEntry;
ULONG Data;
ULONG Data2;
LIST_ENTRY ListEntry;
} MY_DATA, *PMY_DATA;

I have a question:

0:000> !list “-t _LIST_ENTRY.Flink -x "? @@(#CONTAINING_RECORD(@$extret, _MY_DATA, ListEntry));dt _MY_DATA @@(#CONTAINING_RECORD(@$extret, _MY_DATA, ListEntry))" @@(head.Flink)”

Now if I want to print only a few elements in MY_DATA structure and not entire structure , say want to print just Data, Data2 members,
will modifying the above as:

0:000> !list “-t _LIST_ENTRY.Flink -x "? @@(#CONTAINING_RECORD(@$extret, _MY_DATA, ListEntry));dt _MY_DATA @@(#CONTAINING_RECORD(@$extret, _MY_DATA, ListEntry)) Data Data2" @@(head.Flink)”

work?

Note Data and Data2 added towards the end of the command.

Regards,
-Praveen

“Doron Holan” wrote in message news:xxxxx@windbg…
I took the time to try and break down the parameters to !list and wrote
about it last year. Read
http://blogs.msdn.com/doronh/archive/2006/08/10/693769.aspx if you want
to see what I did.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, June 27, 2007 9:58 AM
To: Kernel Debugging Interest List
Subject: Re: [windbg] How do I traverse double/single linked-list and
print few desired fields of the structure that is part of linked list
using windbg?

Praveen Kumar Amritaluru wrote:
> Probably this question has been asked before couple of times and
replied.
> But I dont know/remember the answer.
> I dont want to use LIST_ENTRY as of now.
>
> IS there any extension in windbg to do this currently?
>
> Or the only option is to write a windbg extension? If so, does anyone
know
> of existing windbg extension to do that?

The answer to this seems pretty obvious. If you write your own custom
data structure, then you will surely need your own custom windbg
extension to traverse it.

That’s one darned good reason to use LIST_ENTRY instead of rolling your
own.

One of my favorite features of the GNU gdb debugger is that you can call
named routines in the module under test. I often include debug
functions that are never called in the code, specifically for use within
gdb. It’s a lot easier than writing a formal debugger extension.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


You are currently subscribed to windbg as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

That should work, what happened when you tried it?

d

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Praveen Kumar
Amritaluru
Sent: Thursday, June 28, 2007 11:09 AM
To: Kernel Debugging Interest List
Subject: Re:[windbg] How do I traverse double/single linked-list and
print few desired fields of the structure that is part of linked list
using windbg?

Hi,

I took a look at your article. I find it very useful. Now I am
changing my code to use LIST_ENTRY.

typedef struct _MY_DATA {
LIST_ENTRY ListEntry;
ULONG Data;
ULONG Data2;
LIST_ENTRY ListEntry;
} MY_DATA, *PMY_DATA;

I have a question:

0:000> !list “-t _LIST_ENTRY.Flink -x "?
@@(#CONTAINING_RECORD(@$extret, _MY_DATA, ListEntry));dt _MY_DATA
@@(#CONTAINING_RECORD(@$extret, _MY_DATA, ListEntry))" @@(head.Flink)”

Now if I want to print only a few elements in MY_DATA structure and not
entire structure , say want to print just Data, Data2 members,

will modifying the above as:

0:000> !list “-t _LIST_ENTRY.Flink -x "?
@@(#CONTAINING_RECORD(@$extret, _MY_DATA, ListEntry));dt _MY_DATA
@@(#CONTAINING_RECORD(@$extret, _MY_DATA, ListEntry)) Data Data2"
@@(head.Flink)”

work?

Note Data and Data2 added towards the end of the command.

Regards,

-Praveen

“Doron Holan” mailto:xxxxx > wrote in message news:xxxxx@windbg
news:xxxxx

I took the time to try and break down the parameters to !list and wrote
about it last year. Read
http://blogs.msdn.com/doronh/archive/2006/08/10/693769.aspx
http: if you
want
to see what I did.

d

-----Original Message-----
From: xxxxx@lists.osr.com
mailto:xxxxx
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, June 27, 2007 9:58 AM
To: Kernel Debugging Interest List
Subject: Re: [windbg] How do I traverse double/single linked-list and
print few desired fields of the structure that is part of linked list
using windbg?

Praveen Kumar Amritaluru wrote:
> Probably this question has been asked before couple of times and
replied.
> But I dont know/remember the answer.
> I dont want to use LIST_ENTRY as of now.
>
> IS there any extension in windbg to do this currently?
>
> Or the only option is to write a windbg extension? If so, does anyone
know
> of existing windbg extension to do that?

The answer to this seems pretty obvious. If you write your own custom
data structure, then you will surely need your own custom windbg
extension to traverse it.

That’s one darned good reason to use LIST_ENTRY instead of rolling your
own.

One of my favorite features of the GNU gdb debugger is that you can call
named routines in the module under test. I often include debug
functions that are never called in the code, specifically for use within
gdb. It’s a lot easier than writing a formal debugger extension.


Tim Roberts, xxxxx@probo.com mailto:xxxxx
Providenza & Boekelheide, Inc.


You are currently subscribed to windbg as: xxxxx@microsoft.com
mailto:xxxxx
To unsubscribe send a blank email to xxxxx@lists.osr.com
mailto:xxxxx


You are currently subscribed to windbg as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com</mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></http:></news:xxxxx></mailto:xxxxx>