This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
user defined function and passing types
- From: Pawel K <mafeusek at gmail dot com>
- To: gdb at sourceware dot org
- Date: Fri, 10 Sep 2010 16:41:34 +0200
- Subject: user defined function and passing types
Hallo Group Members.
I have following user defined function:
define my_stl_list
? set $list = ($arg0)
? set $list_size = 0
? set $firstNode = $list._M_head
? set $curNode = $list._M_head._M_next
? while ($curNode != 0)
??? printf "List Element %d: ", $list_size
??? p ((const __gnu_cxx::_Slist_node<int> *)$curNode)->_M_data
??? set $curNode = ($curNode)->_M_next
??? set $list_size++
? end
end
As You can see, it displays contents of slist.
It's drawback is that it has hard coded type of list (const
__gnu_cxx::_Slist_node<int> *).
Is there a way to pass it as parameter to this macro?
best regards,
Pawel