<?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: Debugging shared libraries with gdb in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/debugging-shared-libraries-with-gdb/m-p/5886419#M638892</link>
    <description>&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;Was there a particular feature you wanted in gdb 7.5?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nothing in particular, no. Python scripting support and reversible debugging would be nice, but they're not essential.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just downloaded and installed the latest version I could find on the Porting and Archive Centre, rather than going to the official HP packages. It usually works for everything else, and since the debugger seemed to work and run, I expected that it would work for more or less all features. &amp;nbsp;I knew that HP had some people working on GDB and other open source projects a long time ago (I was a member of the initial HP Caliper team on the same floor as you, Dennis), but I didn't know that it continued to this day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 30 Nov 2012 20:00:57 GMT</pubDate>
    <dc:creator>tlo</dc:creator>
    <dc:date>2012-11-30T20:00:57Z</dc:date>
    <item>
      <title>Debugging shared libraries with gdb</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/debugging-shared-libraries-with-gdb/m-p/5884555#M638888</link>
      <description>&lt;P&gt;HP-UX 11.23, ia64.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using gcc 4.7.0 and gdb 7.5, and I am having problems debugging anything inside a shared library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The creation of the shared library:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; $&amp;nbsp;gcc -c -g3 -fPIC hello.c&lt;/P&gt;
&lt;P&gt;&amp;nbsp; $&amp;nbsp;gcc -g3 -shared hello.o -o libhello.so&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I then compiled and linked an executable against it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; $ gcc -c -g3 foo.c&lt;/P&gt;
&lt;P&gt;&amp;nbsp; $ gcc -g3 foo.o -lhello -L.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can post the contents of hello.c and foo.c if necessary, but I doubt it will matter. The main() in foo.c calls a function in hello.c&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I try to set a breakpoint in gdb, I get this:&lt;/P&gt;
&lt;P&gt;(gdb) break hello&lt;BR /&gt;Function "hello" not defined.&lt;BR /&gt;Make breakpoint pending on future shared library load? (y or [n])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even if I answer yes, the breakpoint is never reached, even though the function is called on execution. &amp;nbsp;Also, if I attempt to step through the statements in foo.c, it steps over the call into the shared library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have also attempted chatr +dbg enable on both the resulting binary and the shared object itself, with the same result.&amp;nbsp;What do I need to do in order to debug a shared library?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S.This thread has been moved from&amp;nbsp;&lt;SPAN&gt;HP-UX&amp;gt;System Administration to HP-UX &amp;gt; languages&lt;/SPAN&gt;- HP Forums Moderator&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2012 06:30:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/debugging-shared-libraries-with-gdb/m-p/5884555#M638888</guid>
      <dc:creator>tlo</dc:creator>
      <dc:date>2012-11-30T06:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging shared libraries with gdb</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/debugging-shared-libraries-with-gdb/m-p/5884987#M638889</link>
      <description>&lt;P&gt;&amp;gt;I am using gcc 4.7.0 and gdb 7.5,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What happens when you used HP's gdb instead?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;What do I need to do in order to debug a shared library?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use HP's gdb instead, that works.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2012 04:06:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/debugging-shared-libraries-with-gdb/m-p/5884987#M638889</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-11-30T04:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging shared libraries with gdb</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/debugging-shared-libraries-with-gdb/m-p/5886325#M638890</link>
      <description>&lt;P&gt;The gdb 6.3 from the HP WDB package does work. Functions from shared libraries are not immediately recognizable (.i.e., I still get "Breakpoint deferred until a shared library containing "hello" is loaded."), but that's only a minor annoyance as program execution actually does break when it hits that function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2012 17:51:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/debugging-shared-libraries-with-gdb/m-p/5886325#M638890</guid>
      <dc:creator>tlo</dc:creator>
      <dc:date>2012-11-30T17:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging shared libraries with gdb</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/debugging-shared-libraries-with-gdb/m-p/5886387#M638891</link>
      <description>&lt;P&gt;&amp;gt;Thanks for the assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are happy with your answers, please click on the Kudos star.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Was there a particular feature you wanted in gdb 7.5?&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2012 19:00:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/debugging-shared-libraries-with-gdb/m-p/5886387#M638891</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-11-30T19:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging shared libraries with gdb</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/debugging-shared-libraries-with-gdb/m-p/5886419#M638892</link>
      <description>&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;Was there a particular feature you wanted in gdb 7.5?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nothing in particular, no. Python scripting support and reversible debugging would be nice, but they're not essential.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just downloaded and installed the latest version I could find on the Porting and Archive Centre, rather than going to the official HP packages. It usually works for everything else, and since the debugger seemed to work and run, I expected that it would work for more or less all features. &amp;nbsp;I knew that HP had some people working on GDB and other open source projects a long time ago (I was a member of the initial HP Caliper team on the same floor as you, Dennis), but I didn't know that it continued to this day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2012 20:00:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/debugging-shared-libraries-with-gdb/m-p/5886419#M638892</guid>
      <dc:creator>tlo</dc:creator>
      <dc:date>2012-11-30T20:00:57Z</dc:date>
    </item>
  </channel>
</rss>

