<?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: attach process to gdb through script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/attach-process-to-gdb-through-script/m-p/4568913#M39404</link>
    <description>Hello.&lt;BR /&gt;&lt;BR /&gt;You can do this like so:&lt;BR /&gt;&lt;BR /&gt;gdb -p "$VAR"&lt;BR /&gt;&lt;BR /&gt;Put commands in ".gdbinit" or in a different file that you pass to gdb with "-x". I recommend to put this in ".gdbinit":&lt;BR /&gt;&lt;BR /&gt;set paginatin off&lt;BR /&gt;&lt;BR /&gt;Then put the rest in another file and call:&lt;BR /&gt;&lt;BR /&gt;gdb -batch -x "myfile" -p "$VAR" &amp;gt; myoutput&lt;BR /&gt;&lt;BR /&gt;You can also set where gdb logs its output inside gdb if you wish.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Goran</description>
    <pubDate>Fri, 22 Jan 2010 10:01:48 GMT</pubDate>
    <dc:creator>Goran Koruga</dc:creator>
    <dc:date>2010-01-22T10:01:48Z</dc:date>
    <item>
      <title>attach process to gdb through script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/attach-process-to-gdb-through-script/m-p/4568912#M39403</link>
      <description>Hello All,&lt;BR /&gt;&lt;BR /&gt;I have a requirement to attach a process to gdb with help of its name in gdb prompt. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I made a script test whose content is :-&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Test_script :-:&amp;gt;&lt;BR /&gt;VAR=`pgrep &lt;PROCESS_NAME&gt;'&lt;BR /&gt;gdb&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and requirement is to attach the process-id in VAR variable to gdb&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;.gdbinit&lt;BR /&gt;attach  VAR&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The script has to be automated and has to collect many gdb related logs about the process stack and registers periodically with different process name.&lt;/PROCESS_NAME&gt;</description>
      <pubDate>Thu, 21 Jan 2010 17:08:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/attach-process-to-gdb-through-script/m-p/4568912#M39403</guid>
      <dc:creator>monu_1</dc:creator>
      <dc:date>2010-01-21T17:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: attach process to gdb through script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/attach-process-to-gdb-through-script/m-p/4568913#M39404</link>
      <description>Hello.&lt;BR /&gt;&lt;BR /&gt;You can do this like so:&lt;BR /&gt;&lt;BR /&gt;gdb -p "$VAR"&lt;BR /&gt;&lt;BR /&gt;Put commands in ".gdbinit" or in a different file that you pass to gdb with "-x". I recommend to put this in ".gdbinit":&lt;BR /&gt;&lt;BR /&gt;set paginatin off&lt;BR /&gt;&lt;BR /&gt;Then put the rest in another file and call:&lt;BR /&gt;&lt;BR /&gt;gdb -batch -x "myfile" -p "$VAR" &amp;gt; myoutput&lt;BR /&gt;&lt;BR /&gt;You can also set where gdb logs its output inside gdb if you wish.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Goran</description>
      <pubDate>Fri, 22 Jan 2010 10:01:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/attach-process-to-gdb-through-script/m-p/4568913#M39404</guid>
      <dc:creator>Goran Koruga</dc:creator>
      <dc:date>2010-01-22T10:01:48Z</dc:date>
    </item>
  </channel>
</rss>

