<?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: adb to debug core file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/adb-to-debug-core-file/m-p/3420402#M707224</link>
    <description>cd to the directory containing the core file.&lt;BR /&gt;gdb /xxx/yyy/zzz/myexethatcrashed core&lt;BR /&gt;&lt;BR /&gt;gdb will immediately do a stack trace with no command needed.&lt;BR /&gt;&lt;BR /&gt;By the way, I suspect the gdb version supplied as part of NNM/VP/O is rather old so you might be well advised to get a newer version.&lt;BR /&gt;&lt;BR /&gt;It's probably a good idea to play a little before doing the real thing. I would create a program that will crash and debug it:&lt;BR /&gt;&lt;BR /&gt;The following should get you started:&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;&lt;BR /&gt;int badboy()&lt;BR /&gt;{&lt;BR /&gt;  char s0[32],s1[4];&lt;BR /&gt;  int i = 0;&lt;BR /&gt;&lt;BR /&gt;  for (i = 0; i &amp;lt; 1000000; ++i)&lt;BR /&gt;    {&lt;BR /&gt;      s0[i] = 'x';&lt;BR /&gt;      s1[i - 100000] = s0[i + 100000];&lt;BR /&gt;    }&lt;BR /&gt;  return(0);&lt;BR /&gt;} /* badboy */&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;  int cc = 0;&lt;BR /&gt;&lt;BR /&gt;  cc = badboy();&lt;BR /&gt;  (void) printf("cc = %d\n",cc);&lt;BR /&gt;  return(cc);&lt;BR /&gt;} /* main */&lt;BR /&gt;&lt;BR /&gt;Compile it like this:&lt;BR /&gt;&lt;BR /&gt;cc -g bad.c -o bad&lt;BR /&gt;next execute bad (it should immediate dump core)&lt;BR /&gt;gdb bad core&lt;BR /&gt;&lt;STACK trace="" will="" be="" display=""&gt;&lt;BR /&gt;q (quit gdb)&lt;BR /&gt;&lt;BR /&gt;(-g is not supported unless you have a development compiler (aCC or ANCI/C) but the Bundled compiler will simply ignore it. -g adds debugging data to the object.&lt;BR /&gt;&lt;BR /&gt;&lt;/STACK&gt;&lt;/STDIO.H&gt;</description>
    <pubDate>Fri, 12 Nov 2004 12:17:43 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2004-11-12T12:17:43Z</dc:date>
    <item>
      <title>adb to debug core file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adb-to-debug-core-file/m-p/3420399#M707221</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I need to debug a core file with adb command, but I have problem to understand the right way to run it.&lt;BR /&gt;&lt;BR /&gt;Can someone help me to understand the correct syntax to work fine this command??&lt;BR /&gt;&lt;BR /&gt;Thanks and best regards,&lt;BR /&gt;Vinc.&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Nov 2004 10:57:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adb-to-debug-core-file/m-p/3420399#M707221</guid>
      <dc:creator>Vincenzo Capasso</dc:creator>
      <dc:date>2004-11-11T10:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: adb to debug core file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adb-to-debug-core-file/m-p/3420400#M707222</link>
      <description>Compared to gdb, adb is very limited so if you can, use gdb. Life is also easier if you can compile with the -g flag to include symbol/debugger data in the object file. In either debugger, the starting point is the stacktrace.&lt;BR /&gt;&lt;BR /&gt;Invoke adb as "adb myexe core"&lt;BR /&gt;$c&lt;BR /&gt;$c&lt;BR /&gt;&lt;BR /&gt;$c -- stack trace; the 1st listed function is where the error occured. &lt;BR /&gt;&lt;BR /&gt;$q -&amp;gt; exits adb&lt;BR /&gt;$h -&amp;gt; help&lt;BR /&gt;&lt;BR /&gt;Gdb can zero in on the exact line of source code if supplied with -g and the source is available. Again, adb is rather limited.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Nov 2004 11:28:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adb-to-debug-core-file/m-p/3420400#M707222</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-11-11T11:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: adb to debug core file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adb-to-debug-core-file/m-p/3420401#M707223</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I try with gdb, but everytime I run it, the follow message show me on prompt:&lt;BR /&gt;"warning: Unknown symbols for 'core'; use the 'symbol-file' command."&lt;BR /&gt;&lt;BR /&gt;Where I wrong ??&lt;BR /&gt;&lt;BR /&gt;The syntax that I use is the follow:&lt;BR /&gt;/opt/OV/contrib/OpC/gdb -core=core&lt;BR /&gt;&lt;BR /&gt;Can U help me??&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;Vinc.</description>
      <pubDate>Fri, 12 Nov 2004 06:49:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adb-to-debug-core-file/m-p/3420401#M707223</guid>
      <dc:creator>Vincenzo Capasso</dc:creator>
      <dc:date>2004-11-12T06:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: adb to debug core file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adb-to-debug-core-file/m-p/3420402#M707224</link>
      <description>cd to the directory containing the core file.&lt;BR /&gt;gdb /xxx/yyy/zzz/myexethatcrashed core&lt;BR /&gt;&lt;BR /&gt;gdb will immediately do a stack trace with no command needed.&lt;BR /&gt;&lt;BR /&gt;By the way, I suspect the gdb version supplied as part of NNM/VP/O is rather old so you might be well advised to get a newer version.&lt;BR /&gt;&lt;BR /&gt;It's probably a good idea to play a little before doing the real thing. I would create a program that will crash and debug it:&lt;BR /&gt;&lt;BR /&gt;The following should get you started:&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;&lt;BR /&gt;int badboy()&lt;BR /&gt;{&lt;BR /&gt;  char s0[32],s1[4];&lt;BR /&gt;  int i = 0;&lt;BR /&gt;&lt;BR /&gt;  for (i = 0; i &amp;lt; 1000000; ++i)&lt;BR /&gt;    {&lt;BR /&gt;      s0[i] = 'x';&lt;BR /&gt;      s1[i - 100000] = s0[i + 100000];&lt;BR /&gt;    }&lt;BR /&gt;  return(0);&lt;BR /&gt;} /* badboy */&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;  int cc = 0;&lt;BR /&gt;&lt;BR /&gt;  cc = badboy();&lt;BR /&gt;  (void) printf("cc = %d\n",cc);&lt;BR /&gt;  return(cc);&lt;BR /&gt;} /* main */&lt;BR /&gt;&lt;BR /&gt;Compile it like this:&lt;BR /&gt;&lt;BR /&gt;cc -g bad.c -o bad&lt;BR /&gt;next execute bad (it should immediate dump core)&lt;BR /&gt;gdb bad core&lt;BR /&gt;&lt;STACK trace="" will="" be="" display=""&gt;&lt;BR /&gt;q (quit gdb)&lt;BR /&gt;&lt;BR /&gt;(-g is not supported unless you have a development compiler (aCC or ANCI/C) but the Bundled compiler will simply ignore it. -g adds debugging data to the object.&lt;BR /&gt;&lt;BR /&gt;&lt;/STACK&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Fri, 12 Nov 2004 12:17:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adb-to-debug-core-file/m-p/3420402#M707224</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-11-12T12:17:43Z</dc:date>
    </item>
  </channel>
</rss>

