From: Pawel K <mafeusek@gmail.com>
To: gdb@sourceware.org
Subject: user defined function and passing types
Date: Fri, 10 Sep 2010 14:41:00 -0000 [thread overview]
Message-ID: <AANLkTik7GMe9GH5GkcFqGBvhxWezAPsNwaVa5a8qZ-3A@mail.gmail.com> (raw)
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
next reply other threads:[~2010-09-10 14:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-10 14:41 Pawel K [this message]
2010-09-10 15:59 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTik7GMe9GH5GkcFqGBvhxWezAPsNwaVa5a8qZ-3A@mail.gmail.com \
--to=mafeusek@gmail.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox