<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting call stack within C/C++ program in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-call-stack-within-c-c-program/m-p/4717367#M660245</link>
    <description>&amp;gt;values of function arguments?&lt;BR /&gt;&lt;BR /&gt;You would have to create your own.  See uwx(3X) and unwind(5).&lt;BR /&gt;&lt;BR /&gt;But depending on the opt level, all you can print out are the 8 parm registers and they may have been changed when you are getting a stack trace.</description>
    <pubDate>Wed, 24 Nov 2010 13:22:49 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2010-11-24T13:22:49Z</dc:date>
    <item>
      <title>Getting call stack within C/C++ program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-call-stack-within-c-c-program/m-p/4717363#M660241</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Is there any system call that enables to get call stack within C/C++ program?&lt;BR /&gt;&lt;BR /&gt;(Sometimes) I would like to use it instead of assert().&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;assert(condition);&lt;BR /&gt;If assert() fails we have got coredump and can get call stack using gdb.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I need something like&lt;BR /&gt;if (!condition)&lt;BR /&gt;{&lt;BR /&gt;   get-call-stack(); &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Nov 2010 06:17:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-call-stack-within-c-c-program/m-p/4717363#M660241</guid>
      <dc:creator>Alex Vinokur</dc:creator>
      <dc:date>2010-11-24T06:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Getting call stack within C/C++ program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-call-stack-within-c-c-program/m-p/4717364#M660242</link>
      <description>If you want to print a stack trace of the current thread to stderr, on Integrity you can do:&lt;BR /&gt;#include &lt;UNWIND.H&gt;&lt;BR /&gt;U_STACK_TRACE();&lt;BR /&gt;&lt;BR /&gt;For C applications, you need to link with -lunwind.&lt;/UNWIND.H&gt;</description>
      <pubDate>Wed, 24 Nov 2010 11:20:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-call-stack-within-c-c-program/m-p/4717364#M660242</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-11-24T11:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Getting call stack within C/C++ program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-call-stack-within-c-c-program/m-p/4717365#M660243</link>
      <description>Excellent. Thanks.&lt;BR /&gt;Two questions are below&lt;BR /&gt;&lt;BR /&gt;// --- a.cpp ----&lt;BR /&gt;#include &lt;UNWIND.H&gt;&lt;BR /&gt;&lt;BR /&gt;void foo1 (int i)&lt;BR /&gt;{&lt;BR /&gt; U_STACK_TRACE();&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;void foo2 (int i1, int i2)&lt;BR /&gt;{&lt;BR /&gt; foo1 (i1 + i2);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt; foo2 (100, 200);&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;BR /&gt;// ----------&lt;BR /&gt;&lt;BR /&gt;&amp;gt; aCC +DD64 -AA -g a.cpp&lt;BR /&gt;&lt;BR /&gt;&amp;gt; a.out&lt;BR /&gt;(0)  0x4000000000000e50  _Z4foo1i + 0x40 at a.cpp:6 [./a.out]&lt;BR /&gt;(1)  0x4000000000000f20  _Z4foo2ii + 0x30 at a.cpp:11 [./a.out]&lt;BR /&gt;(2)  0x4000000000000fe0  main + 0x30 at a.cpp:16 [./a.out]&lt;BR /&gt;(3)  0xc000000000042450  main_opd_entry + 0x50 [/usr/lib/hpux64/dld.so]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;====================&lt;BR /&gt;Question-1. Is it possible to print demangled names?&lt;BR /&gt;Ouestion-2. Is it possiblr to print also values of function arguments?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;/UNWIND.H&gt;</description>
      <pubDate>Wed, 24 Nov 2010 11:43:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-call-stack-within-c-c-program/m-p/4717365#M660243</guid>
      <dc:creator>Alex Vinokur</dc:creator>
      <dc:date>2010-11-24T11:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Getting call stack within C/C++ program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-call-stack-within-c-c-program/m-p/4717366#M660244</link>
      <description>No problem with demangled names.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; ./a.out | &amp;amp; c++filt&lt;BR /&gt;(0)  0x4000000000000e50  foo1(int) + 0x40 at a.cpp:6 [./a.out]&lt;BR /&gt;(1)  0x4000000000000f20  foo2(int,int) + 0x30 at a.cpp:11 [./a.out]&lt;BR /&gt;(2)  0x4000000000000fe0  main + 0x30 at a.cpp:16 [./a.out]&lt;BR /&gt;(3)  0xc000000000042450  main_opd_entry + 0x50 [/usr/lib/hpux64/dld.so]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So, only second question: values of function arguments?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Nov 2010 12:01:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-call-stack-within-c-c-program/m-p/4717366#M660244</guid>
      <dc:creator>Alex Vinokur</dc:creator>
      <dc:date>2010-11-24T12:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Getting call stack within C/C++ program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-call-stack-within-c-c-program/m-p/4717367#M660245</link>
      <description>&amp;gt;values of function arguments?&lt;BR /&gt;&lt;BR /&gt;You would have to create your own.  See uwx(3X) and unwind(5).&lt;BR /&gt;&lt;BR /&gt;But depending on the opt level, all you can print out are the 8 parm registers and they may have been changed when you are getting a stack trace.</description>
      <pubDate>Wed, 24 Nov 2010 13:22:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-call-stack-within-c-c-program/m-p/4717367#M660245</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-11-24T13:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Getting call stack within C/C++ program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-call-stack-within-c-c-program/m-p/4717368#M660246</link>
      <description>Dennis, thank you.</description>
      <pubDate>Wed, 24 Nov 2010 14:01:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-call-stack-within-c-c-program/m-p/4717368#M660246</guid>
      <dc:creator>Alex Vinokur</dc:creator>
      <dc:date>2010-11-24T14:01:56Z</dc:date>
    </item>
  </channel>
</rss>

