<?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: assembly listing from cc in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/assembly-listing-from-cc/m-p/3931927#M97325</link>
    <description>Not sure if the ANSI C compiler can do that but you can certainly use gdb to get the assembly listing for each of the functions in your source code.&lt;BR /&gt;&lt;BR /&gt;~cheers</description>
    <pubDate>Wed, 24 Jan 2007 11:54:58 GMT</pubDate>
    <dc:creator>Sandman!</dc:creator>
    <dc:date>2007-01-24T11:54:58Z</dc:date>
    <item>
      <title>assembly listing from cc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/assembly-listing-from-cc/m-p/3931926#M97324</link>
      <description>Is there a way to generate an assembler listing with embedded C source code from the hp-ux cc compiler, similar to using the -Wa,alh options to gcc?  (Input to compiler is a C file).</description>
      <pubDate>Wed, 24 Jan 2007 05:52:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/assembly-listing-from-cc/m-p/3931926#M97324</guid>
      <dc:creator>unconsoled</dc:creator>
      <dc:date>2007-01-24T05:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: assembly listing from cc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/assembly-listing-from-cc/m-p/3931927#M97325</link>
      <description>Not sure if the ANSI C compiler can do that but you can certainly use gdb to get the assembly listing for each of the functions in your source code.&lt;BR /&gt;&lt;BR /&gt;~cheers</description>
      <pubDate>Wed, 24 Jan 2007 11:54:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/assembly-listing-from-cc/m-p/3931927#M97325</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-01-24T11:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: assembly listing from cc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/assembly-listing-from-cc/m-p/3931928#M97326</link>
      <description>As a follow-up to my last post you can get the assembly source listing from the ANSI C compiler as long as you provide the "-S" option on the command line to the C compiler. For ex. if you have a C source code file named "myprog.c" then compile as below:&lt;BR /&gt;&lt;BR /&gt;# cc -S myprog.c&lt;BR /&gt;&lt;BR /&gt;the above command will create an assembly language listing of your C source code in a file that ends with the ".s" suffix. Check for a file named "myprog.s" in the dir where "myprog.c" is located.&lt;BR /&gt;&lt;BR /&gt;~hope it helps</description>
      <pubDate>Wed, 24 Jan 2007 13:14:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/assembly-listing-from-cc/m-p/3931928#M97326</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-01-24T13:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: assembly listing from cc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/assembly-listing-from-cc/m-p/3931929#M97327</link>
      <description>Thanks for your replies.  I had previously generated both the .s file using -S and a disassembly from the executable using gdb disassem func.  What I was trying to avoid (although have now largely done) was the laborious process of trying to match the assembler to the 'C' code, which can be particularly time consuming when compiling with high levels of optimization (which I am).  The gcc compiler will do this for you using the -Wa,alh flags, but it seems the hp ansi c compiler (cc) will not (or at least I haven't managed to find a way of making it).  It does seem possible to do so to some degree if optimization is turned off but then the assembler no longer matches my executable, which defeats the point.</description>
      <pubDate>Wed, 24 Jan 2007 13:31:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/assembly-listing-from-cc/m-p/3931929#M97327</guid>
      <dc:creator>unconsoled</dc:creator>
      <dc:date>2007-01-24T13:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: assembly listing from cc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/assembly-listing-from-cc/m-p/3931930#M97328</link>
      <description>About as close as your are going to get is&lt;BR /&gt;cc -g -S myfile.c to include the debugger data in the .s file. That will give you source file line numbers as comments in the assembly source but the "gotcha" is that -g turns off optimization.</description>
      <pubDate>Wed, 24 Jan 2007 15:12:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/assembly-listing-from-cc/m-p/3931930#M97328</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-01-24T15:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: assembly listing from cc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/assembly-listing-from-cc/m-p/3931931#M97329</link>
      <description>As mentioned by Sandman, -S is the option.  Note this output is for informational purposes only and you can't expect to assemble it or change and reassemble it.&lt;BR /&gt;&lt;BR /&gt;What is the reason you want to see the C code mapping?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Clay: About as close as your are going to get is: cc -g -S myfile.c&lt;BR /&gt;&lt;BR /&gt;You can use -g +O2 -S and still get those line numbers.  But you can't do it with +O3 or +O4 on PA.</description>
      <pubDate>Wed, 24 Jan 2007 23:30:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/assembly-listing-from-cc/m-p/3931931#M97329</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-01-24T23:30:28Z</dc:date>
    </item>
  </channel>
</rss>

