<?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: Frame size calculation in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/freame-size-calculation/m-p/4596636#M679666</link>
    <description>&lt;P&gt;FYI, a colleague noticed you have a bounds error in foo3, your buf isn't large enough for the strcpy.&lt;BR /&gt;Compiling with +wlint shows the error right away:&lt;BR /&gt;procedure foo3: warning #20206-D: Possible out of bound access (In expression "strcpy((char*)buf, (const char*))", variable "buf" (type: char [32]) has byte range [0 .. 31], writing byte range [0 .. 33].)&lt;/P&gt;</description>
    <pubDate>Mon, 22 Aug 2011 02:38:56 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2011-08-22T02:38:56Z</dc:date>
    <item>
      <title>Freame size calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freame-size-calculation/m-p/4596630#M679660</link>
      <description>Hi,&lt;BR /&gt; I am working on Stack unwinding on HP Itanium and wrt a recent thread on calculating the Frame size(&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1410703)" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1410703)&lt;/A&gt; i was trying to calculate the frame size with Stack pointer and Prev Stack pointer, and with BSP and Prev BSP values. PFA my sample code. When i print the values for Frame size with Memory stack, and when i debug(using wdb) the values  showed for Size of Frame in 'frame info' command looks different. Why is this so. For eg : For frame 2 i am getting the frame size as 20 from the gdb and in my program i get as 64.  &lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 08 Mar 2010 10:17:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freame-size-calculation/m-p/4596630#M679660</guid>
      <dc:creator>Suchitra Venugopal</dc:creator>
      <dc:date>2010-03-08T10:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Frame size calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freame-size-calculation/m-p/4596631#M679661</link>
      <description>&lt;P&gt;&amp;gt;values showed for Size of Frame in 'frame info' command looks different. For frame 2, I am getting the frame size as 20 from the gdb and in my program I get as 64.&lt;BR /&gt;&lt;BR /&gt;The values from "info frame" are register frame, in registers. The values for memory frame are always a multiple of 16 bytes.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2011 02:40:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freame-size-calculation/m-p/4596631#M679661</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-08-22T02:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Freame size calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freame-size-calculation/m-p/4596632#M679662</link>
      <description>Hi,&lt;BR /&gt; The value shown in Info frame and the frame size calculated by getting the difference of BSP for current frame and previous frame also lpoks differnt. For eg: For frame 4 the value shown in wdb Info frame is 5 and that using the program i sent is 24. &lt;BR /&gt;&lt;BR /&gt;  And what exactly is the frame size. I get different values in Wdb, the calulation of frame size using SP and PSP and the calculation using BSP and previous BSP. Which among this is the actual one ?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Mar 2010 05:20:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freame-size-calculation/m-p/4596632#M679662</guid>
      <dc:creator>Suchitra Venugopal</dc:creator>
      <dc:date>2010-03-09T05:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Frame size calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freame-size-calculation/m-p/4596633#M679663</link>
      <description>&lt;P&gt;&amp;gt;The value shown in info frame and the frame size calculated by getting the difference of BSP for current frame and previous frame also looks different.&lt;BR /&gt;&lt;BR /&gt;Several reasons. The value gdb uses is based on the CFM register and is the number of registers.&lt;BR /&gt;The value you compute is the size of the previous register frame. And every 63 registers, contains a NaT register.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;And what exactly is the frame size?&lt;BR /&gt;&lt;BR /&gt;There are two frames. To keep it simple, you should only print out the memory frame size. If you want to print out the number of registers in the register frame, you can do that too but they are separate.&lt;BR /&gt;&lt;BR /&gt;You have several coding style problems with your source.&lt;BR /&gt;You are going off the right by indentation. Instead you should use gotos, return or break to limit the indent.&lt;BR /&gt;&lt;BR /&gt;You are using evil prespacing, Fortran carriage control or COBOL AFTER ADVANCING. This doesn't belong with C.&lt;BR /&gt;I.e. Don't use "\n" at the start of your formats, only if you don't know what has been output before.&lt;BR /&gt;&lt;BR /&gt;Attached is where I have rewritten everything to use CFM register.&lt;BR /&gt;&lt;BR /&gt;Ret add is 60000000c00269f0&lt;BR /&gt;IP is 40032c0 Current function name is: main&lt;BR /&gt;Sp = 200000007fffed70 PSp = 200000007fffed70&lt;BR /&gt;Memory Frame size = 0&lt;BR /&gt;BSP = 200000007fffed70 CFM = c000000000000103&lt;BR /&gt;Reg Frame size = 24&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2011 02:40:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freame-size-calculation/m-p/4596633#M679663</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-08-22T02:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Freame size calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freame-size-calculation/m-p/4596634#M679664</link>
      <description>Thanks Dennis.&lt;BR /&gt;Now also when i run and check the frame size in gdb and the one you calculated using CFM, they are different. &lt;BR /&gt;&lt;BR /&gt;For a frame where memory stack frame size is 0, can we take register frame size as the frame size ? (BSP-prev BSP or the one calculated using CFM) ?</description>
      <pubDate>Tue, 09 Mar 2010 11:40:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freame-size-calculation/m-p/4596634#M679664</guid>
      <dc:creator>Suchitra Venugopal</dc:creator>
      <dc:date>2010-03-09T11:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: Frame size calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freame-size-calculation/m-p/4596635#M679665</link>
      <description>&lt;P&gt;&amp;gt;when I run and check the frame size in gdb and the one you calculated using CFM, they are different.&lt;BR /&gt;&lt;BR /&gt;Well, 8 times bigger since I converted it to bytes.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;For a frame where memory stack frame size is 0, can we take register frame size as the frame size?&lt;BR /&gt;&lt;BR /&gt;The memory frame size is the memory frame size. Zero is a valid value, don't be scared. :-)&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2011 02:39:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freame-size-calculation/m-p/4596635#M679665</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-08-22T02:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Frame size calculation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/freame-size-calculation/m-p/4596636#M679666</link>
      <description>&lt;P&gt;FYI, a colleague noticed you have a bounds error in foo3, your buf isn't large enough for the strcpy.&lt;BR /&gt;Compiling with +wlint shows the error right away:&lt;BR /&gt;procedure foo3: warning #20206-D: Possible out of bound access (In expression "strcpy((char*)buf, (const char*))", variable "buf" (type: char [32]) has byte range [0 .. 31], writing byte range [0 .. 33].)&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2011 02:38:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/freame-size-calculation/m-p/4596636#M679666</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-08-22T02:38:56Z</dc:date>
    </item>
  </channel>
</rss>

