<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Srijan&#039;s Blog</title>
	<atom:link href="http://srijan.com.np/feed/" rel="self" type="application/rss+xml" />
	<link>http://srijan.com.np</link>
	<description>My tryst with research</description>
	<lastBuildDate>Wed, 25 Aug 2010 20:31:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Install Acrobat Reader and Adobe Flash on 64-bit Fedora</title>
		<link>http://srijan.com.np/2010/08/install-acrobat-reader-and-adobe-flash-on-64-bit-fedora/</link>
		<comments>http://srijan.com.np/2010/08/install-acrobat-reader-and-adobe-flash-on-64-bit-fedora/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 20:51:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Install Acrobat Reader 64-bit Fedora]]></category>
		<category><![CDATA[Install Acrobat Reader on Fedora 10]]></category>
		<category><![CDATA[Install Acrobat Reader on Fedora 11]]></category>
		<category><![CDATA[Install Acrobat Reader on Fedora 12+]]></category>
		<category><![CDATA[Install Adobe Flash on 64-bit Linux]]></category>
		<category><![CDATA[Install Adobe Flash on Fedora 10]]></category>
		<category><![CDATA[Install Adobe Flash on Fedora 11]]></category>
		<category><![CDATA[Install Adobe Flash on Fedora 12+]]></category>

		<guid isPermaLink="false">http://srijan.com.np/?p=32</guid>
		<description><![CDATA[Installing Acrobat Reader and Flash Player on 64 bit Linux machines Acrobat Reader Download and install the Adobe Release RPM (one-time step only) wget http://linuxdownload.adobe.com/linux/i386/adobe-release-i386-1.0-1.noarch.rpm rpm -ivh adobe-release-i386-1.0-1.noarch.rpm Run the Yum command with the Adobe Reader for your language, as follows: For first time installations: yum install AdobeReader_enu For updates: yum update AdobeReader_enu Run Acrobat [...]]]></description>
			<content:encoded><![CDATA[<p>Installing Acrobat Reader and Flash Player on 64 bit Linux machines</p>
<p><strong>Acrobat Reader</strong></p>
<ol>
<li> Download and install the Adobe Release RPM (one-time step only)<br />
<code>wget http://linuxdownload.adobe.com/linux/i386/adobe-release-i386-1.0-1.noarch.rpm<br />
rpm -ivh adobe-release-i386-1.0-1.noarch.rpm</code></li>
<li>Run the Yum command with the Adobe Reader for your language, as follows:<br />
For first time installations:<br />
<code>yum install AdobeReader_enu</code><br />
For updates:<br />
<code>yum update AdobeReader_enu</code></li>
<li>Run Acrobat Reader<br />
<code>acroread &amp;</code></li>
</ol>
<p><em>Note: It might complain a bit about some lib file when running for the first time, but that shouldn&#8217;t stop it from running or working properly</em></p>
<p><strong>Adobe Flash</strong></p>
<ol>
<li>Make use of the same Adobe repo file used by Acrobat Reader</li>
<li>Download yum version of flash player from: http://get.adobe.com/flashplayer/</li>
<li>Run:
<p>[For Fedora 10]<br />
<code>su -c 'yum install flash-plugin nspluginwrapper.x86_64 \<br />
nspluginwrapper.i386 alsa-plugins-pulseaudio.i386 \<br />
libcurl.i386'</code></p>
<p>[For Fedora 11]<br />
<code>su -c 'yum install flash-plugin nspluginwrapper.x86_64 \<br />
nspluginwrapper.i586 alsa-plugins-pulseaudio.i586 \<br />
libcurl.i586'</code></p>
<p>[For Fedora 12 and 13]<br />
<code>su -c 'yum install flash-plugin nspluginwrapper.x86_64 \<br />
nspluginwrapper.i686 alsa-plugins-pulseaudio.i686 \<br />
libcurl.i686'</code></li>
</ol>
<p>[Source: http://fedoraproject.org/wiki/Flash]</p>
]]></content:encoded>
			<wfw:commentRss>http://srijan.com.np/2010/08/install-acrobat-reader-and-adobe-flash-on-64-bit-fedora/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable GUI in Linux</title>
		<link>http://srijan.com.np/2010/08/disable-gui-in-linux/</link>
		<comments>http://srijan.com.np/2010/08/disable-gui-in-linux/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 14:27:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Disable Linux GUI]]></category>

		<guid isPermaLink="false">http://srijan.com.np/?p=23</guid>
		<description><![CDATA[Have you ever come across a situation when you wanted to disable GUI in your Linux box? Well I have. I just got a brand new GPU server running Ubuntu 10.04 and as users at my lab are supposed to submit jobs to the machine remotely, I don&#8217;t actually need GUI running on it. Moreover, [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever come across a situation when you wanted to disable GUI in your Linux box? Well I have. I just got a brand new GPU server running Ubuntu 10.04 and as users at my lab are supposed to submit jobs to the machine remotely, I don&#8217;t actually need GUI running on it. Moreover, GUI consumes a lot of system resources which can be put to better use someplace else and there is always the threat of some security holes when you&#8217;re using X. If you happen to be running Ubuntu or another Debian based machine you will need to do this:</p>
<p>    # update-rc.d -f gdm remove</p>
<p>This command does require root privileges. Also, this command assumes you are running GNOME. If you are running KDE it would look like this:</p>
<p>    # update-rc.d -f kdm remove</p>
<p>If you are running XFCE, it will look like this:</p>
<p>    # update-rc.d -f xdm remove</p>
<p>To load the GUI for the duration of a logged in session, use this command:</p>
<p>    startx</p>
<p>If you later decide that you do want the GUI to be running all the time, use this command to do so:</p>
<p>    # update-rc.d -f gdm defaults</p>
<p>Switch gdm for kdm or xdm as appropriate. </p>
<p>For other Linux distribution, you need to edit the file <strong>/etc/inittab</strong></p>
<p>Go to the line that says:<br />
id:5:initdefault:</p>
<p>Change the 5 to a 3<br />
id:3:initdefault:</p>
<p>All you&#8217;re doing is changing the default run level from 5 to 3 </p>
<p>And for Ubuntu that has grub2 (10.04 for eg): Edit /etc/default/grub<br />
Replace<br />
GRUB_CMDLINE_LINUX_DEFAULT=&#8221;quiet splash&#8221;<br />
with<br />
GRUB_CMDLINE_LINUX_DEFAULT=&#8221;text&#8221;</p>
<p>And uncomment the line<br />
#GRUB_TERMINAL=console<br />
to enable console login</p>
<p>then source the file to produce /boot/grub/grub.cfg configuration file <strong>sudo update-grub2</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://srijan.com.np/2010/08/disable-gui-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging in Linux with GDB</title>
		<link>http://srijan.com.np/2010/08/debugging-in-linux-with-gdb/</link>
		<comments>http://srijan.com.np/2010/08/debugging-in-linux-with-gdb/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 19:59:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Debugging in Linux]]></category>
		<category><![CDATA[GDB]]></category>

		<guid isPermaLink="false">http://srijan.com.np/?p=17</guid>
		<description><![CDATA[I came across this nice piece of tutorial regarding debugging with GDB. You can find the entire tutorial here. To be able to debug a program, you need to compile it with debugging information enabled so that gdb can work with variables, their state and values, lines and functions. To do this, compile your program [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">I came across this nice piece of tutorial regarding debugging with GDB. You can find the entire tutorial <a href="http://www.ibm.com/developerworks/library/l-gdb/">here</a>.</p>
<p style="text-align: left;">To be able to debug a program, you need to compile it with debugging information enabled so that gdb can work with variables, their state and values, lines and functions. To do this, compile your program under gcc (or g++) with an extra &#8216;-g&#8217; option:</p>
<p style="text-align: left;">example: <strong>gcc -g test.c -o test</strong></p>
<h3 style="text-align: left;">Running gdb</h3>
<p style="text-align: left;">Simply run gdb from the shell and pass the program name as parameter: <strong>gdb test</strong></p>
<p style="text-align: left;">Once your program is loaded, start the execution by typing gdb command<strong> run</strong>.</p>
<p style="text-align: left;">An example:</p>
<p style="text-align: left;">If nothing is wrong your program will execute to completion, at which point gdb will get control back. But what if something does go wrong? In this case gdb will take control and interrupt the program, allowing you to examine the state of everything and hopefully find out why. To provoke this scenario we&#8217;ll use an example program:</p>
<p style="text-align: left;"><code>#include<br />
int wib(int no1, int no2)<br />
{<br />
int result, diff;<br />
diff = no1 - no2;<br />
result = no1 / diff;<br />
return result;<br />
}<br />
int main(int argc, char *argv[])<br />
{<br />
int value, div, result, i, total;<br />
value = 10;<br />
div = 6;<br />
total = 0;<br />
for(i = 0; i &lt; 10; i++)<br />
{<br />
result = wib(value, div);<br />
total += result;<br />
div++;<br />
value--;<br />
}<br />
printf("%d wibed by %d equals %d\n", value, div, total);<br />
return 0;<br />
}<br />
</code></p>
<p style="text-align: left;">This program runs around a for loop 10 times, calculating a cumulative value using the &#8216;wib()&#8217; function and finally printing out the result.</p>
<p style="text-align: left;">Enter it into your favorite text editor with the same line spacings, save as &#8216;test.c&#8217;, compile with &#8216;gcc -g test.c -o test&#8217; and start gdb with &#8216;gdb test&#8217;. Running the program using &#8216;run&#8217; will result in a message something like:</p>
<p style="text-align: left;">Program received signal SIGFPE, Arithmetic exception.<br />
0x80483ea in wib (no1=8, no2=8) at test.c:7<br />
7         result = no1 / diff;<br />
(gdb)</p>
<p style="text-align: left;">Gdb indicates that the program gets an arithmetic exception at line 7 and usefully prints out the line and the values of the arguments to the wib() function. To see the source code around line 7 use the command &#8216;<strong>list</strong>&#8216;, which usually prints 10 lines. Typing &#8216;<strong>list</strong>&#8216; again (or pressing return which repeats the last command) will list the next 10 lines of the program. From the gdb message something is going wrong with the divide at line 7 where the program divides the variable &#8220;no1&#8243; by &#8220;diff&#8221;.</p>
<p style="text-align: left;">To see the values of variables the gdb &#8216;print&#8217; command is used with the variable name. We can see what &#8220;no1&#8243; and &#8220;diff&#8221; are equal to by typing &#8216;print no1&#8242; and &#8216;print diff&#8217;, resulting in:</p>
<p style="text-align: left;">(gdb) print no1<br />
$5 = 8<br />
(gdb) print diff<br />
$2 = 0</p>
<p style="text-align: left;">Gdb indicates that &#8220;no1&#8243; equals 8 and &#8220;diff&#8221; equals 0. From these values and line 7 we can deduce that the arithmetic exception is due to a divide by zero. The listing shows the variable &#8220;diff&#8221; being calculated on line 6, which we can re-evaluate by supplying the &#8220;diff&#8221; expression to print as &#8216;print no1 &#8211; no2&#8242;. Gdb told us that the arguments to the wib function were both equal to 8 so we might wish to examine the main() function which calls wib() to see when this happens. In the meantime to allow our program to die naturally we tell gdb to carry on execution with the &#8216;continue&#8217; command:</p>
<p style="text-align: left;">(gdb) continue<br />
Continuing.<br />
Program terminated with signal SIGFPE, Arithmetic exception.<br />
The program no longer exists.</p>
<p style="text-align: left;">Another Example from <a href="http://people.gnome.org/~newren/tutorials/developing-with-gnome/html/ch03.html">gnome.org</a></p>
<p>It is easiest to explain with an example.  A good example is         <tt>gdb-example.c</tt>, which is listed below.  It         is a simple, yet buggy program that we will run under gdb.</p>
<pre>#include "stdio.h"
void print_scrambled(char *message)
{
  int i = 3;
  do {
    printf("%c", (*message)+i);
  } while (*++message);
  printf("\n");
}

int
main()
{
  char * bad_message = NULL;
  char * good_message = "Hello, world.";

  print_scrambled(good_message);
  print_scrambled(bad_message);
}
</pre>
<div lang="en">
<div>
<div>
<div>
<h3>Basic usage</h3>
</div>
</div>
</div>
<p>In order to run programs under gdb, they should be compiled         with debugging symbols turned on and with optimization flags         turned off (this is not strictly necessary, but not doing this         can make gdb output impossible to read or follow).</p>
<pre><tt><tt>104 newren@Miney:~/examples$</tt> <strong>gcc -g gdb-example.c -o gdb-example</strong></tt></pre>
<p>Because of a bug in the program, running it will result in a         segmentation fault:</p>
<pre><tt><tt>105 newren@Miney:~/examples$</tt> <strong>./gdb-example</strong>
Khoor/#zruog1
Segmentation fault</tt></pre>
<p>This is one of the areas where gdb comes in handy.  By running         the program under gdb, we can find out the exact line that the         program is crashing on.</p>
<pre><tt><tt>106 newren@Miney:~/examples$</tt> <strong>gdb gdb-example</strong>
GNU gdb Red Hat Linux (5.3.90-0.20030710.41rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) <strong><tt>run</tt></strong>
Starting program: /home/newren/examples/gdb-example
Khoor/#zruog1
Program received signal SIGSEGV, Segmentation fault.
0x0804835b in print_scrambled (message=0x0) at gdb-example.c:8
8           printf("%c", (*message)+i);
(gdb) <strong><tt>backtrace</tt></strong>
#0  0x0804835b in print_scrambled (message=0x0) at gdb-example.c:8
#1  0x080483c3 in main () at gdb-example.c:20
(gdb) <strong><tt>quit</tt></strong>
The program is running.  Exit anyway? (y or n) <strong><tt>y</tt></strong>
107 newren@Miney:debugging/gdb$</tt></pre>
<p>Here, we did not need to run the backtrace command since gdb         already showed that the crash occurred at line eight of         gdb-example.c in the function print_scrambled.  However, it is         often useful to know which function calls occurred in order to         get to the line where the program crashed.  The backtrace         command produces a list of the function calls, which is known         as either a backtrace or a stack trace.</p>
<p>Reading backtraces is fairly straightforward.  The data         associated with each function call in the list is known as a         <em>frame</em>.  The outermost frame is the         initial function that your program started in, and is printed         at the bottom of the list.  Each frame is given a number (0,         1, 2, etc.).  Following the frame number is an associated         memory address, which is almost entirely useless and which you         can ignore.  Then each frame contains the name of the function         that was called, its arguments, the name of the file where the         function appears, and line number.  So, the stack trace for         our program says that at line 20 of gdb-example.c in function         main, the print_scrambled function was called&#8211;and that the         program got to line eight of gdb-example.c inside the         print_scrambled function.</p>
</div>
<div lang="en">
<div>
<div>
<div>
<h3><a name="gdb-more-info"></a>Getting more information</h3>
</div>
</div>
</div>
<p>Getting a backtrace may provide enough information, but it is         sometimes helpful to get more information, such as the values         of arguments or local variables.  Another convenience provided         by gdb is listing a small segment of the code around where the         program is currently stopped so you can see which statements         have been executed and which ones are about to be.  The         following gdb session demonstrates how to do these things as         well as how to switch to previous stack frames using the up         command.</p>
<pre><tt><tt>142 newren@Miney:~/examples$</tt> <strong>gdb gdb-example</strong>
GNU gdb Red Hat Linux (5.3.90-0.20030710.41rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) <strong><tt>run</tt></strong>
Starting program: /home/newren/examples/gdb-example
Khoor/#zruog$
Program received signal SIGSEGV, Segmentation fault.
0x0804835b in print_scrambled (message=0x0) at gdb-example.c:8
8           printf("%c", (*message)+i);
(gdb) <strong><tt>backtrace</tt></strong>
#0  0x0804835b in print_scrambled (message=0x0) at gdb-example.c:8
#1  0x080483c3 in main () at gdb-example.c:20
(gdb) <strong><tt>list</tt></strong>
<code>
3       void
4       print_scrambled(char *message)
5       {
6         int i = 3;
7         do {
8           printf("%c", (*message)+i);
9         } while (*++message);
10        printf("\n");
11      }
</code>12
(gdb) <strong><tt>info locals</tt></strong>
i = 3
(gdb) <strong><tt>info args</tt></strong>
message = 0x0
(gdb) <strong><tt>up</tt></strong>
#1  0x080483c3 in main () at gdb-example.c:20
20        print_scrambled(bad_message);
(gdb) <strong><tt>list</tt></strong>
15      {
16        char * bad_message = NULL;
17        char * good_message = "Hello, world.";
18
19        print_scrambled(good_message);
20        print_scrambled(bad_message);
21      }
(gdb) <strong><tt>info locals</tt></strong>
bad_message = 0x0
good_message = 0x80484a1 "Hello, world."
(gdb) <strong><tt>info args</tt></strong>
No arguments.
(gdb) <strong><tt>quit</tt></strong>
The program is running.  Exit anyway? (y or n) <strong><tt>y</tt></strong>
<tt>143 newren@Miney:~/examples$</tt>
</tt></pre>
<p>From the gdb output, it is fairly clear that the list, info         locals, and info args commands get information about the         currently selected stack frame.  Besides using the up command         to go choose a previous frame, you can also use the down         command to choose a later one or use the frame command (with a         numeric argument) to choose which stack frame to switch to.</p>
</div>
<div lang="en">
<div>
<div>
<div>
<h3><a name="gdb-walking"></a>Walking through the program</h3>
</div>
</div>
</div>
<p>gdb can also allow you to walk through the program         while it is running so that you can trace its steps carefully.         The following gdb session illustrates this, using the break,         print, next, and step commands.</p>
<pre><tt><tt>143 newren@Miney:~/examples$</tt> <strong>gdb gdb-example</strong>
GNU gdb Red Hat Linux (5.3.90-0.20030710.41rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) <strong><tt>break main</tt></strong>
Breakpoint 1 at 0x804839c: file gdb-example.c, line 16.
(gdb) <strong><tt>run</tt></strong>
Starting program: /home/newren/examples/gdb-example
Breakpoint 1, main () at gdb-example.c:16
16        char * bad_message = NULL;
(gdb) <strong><tt>print bad_message</tt></strong>
$1 = 0x8048410 "U\211%G%@VS"
(gdb) <strong><tt>next</tt></strong>
17        char * good_message = "Hello, world.";
(gdb) <strong><tt>print bad_message</tt></strong>
$2 = 0x0
(gdb) <strong><tt>next</tt></strong>
19        print_scrambled(good_message);
(gdb) <strong><tt>next</tt></strong>
Khoor/#zruog$
20        print_scrambled(bad_message);
(gdb) <strong><tt>step</tt></strong>
print_scrambled (message=0x0) at gdb-example.c:6
6         int i = 3;
(gdb) <strong><tt>step</tt></strong>
8           printf("%c", (*message)+i);
(gdb) <strong><tt>step</tt></strong>
Program received signal SIGSEGV, Segmentation fault.
0x0804835b in print_scrambled (message=0x0) at gdb-example.c:8
8           printf("%c", (*message)+i);
(gdb) <strong><tt>print (*message)+i</tt></strong>
Cannot access memory at address 0x0
(gdb) <strong><tt>quit</tt></strong>
The program is running.  Exit anyway? (y or n) <strong><tt>y</tt></strong>
<tt>144 newren@Miney:~/examples$</tt>
</tt></pre>
<p>The break command sets a breakpoint&#8211;a location in the program         where gdb should stop when it gets to there.  Breakpoints can         be set at the beginning of a function or at specific lines in         program file.  There are many things that can be done with         breakpoints, such as making them conditional or temporary.  In         this example, a common and simple usage case was shown that         had gdb stop at the beginning of the main function.</p>
<p>The next and step commands were used to make gdb move forward         in the program.  For statements that do not involve functions,         the next and step commands are identical and merely make gdb         execute one statement.  For statements that involve a         function, however, the two commands are different.  next tells         gdb to execute the entire function, while step tells gdb to         move inside the function.</p>
<p>The print command displays the value of variables or         expressions.  In the example, the bad_message variable was         shown both before and after it was initialized.  Later in the         example, gdb responded that it could not display the         expression <tt>(*message)+i</tt> because a pointer         (the message variable) had a NULL (meaning invalid) value.  In         fact, this is the bug in this program&#8211;print_scrambled does         not check to see whether its argument contains a valid value.</p>
</div>
<div lang="en">
<div>
<div>
<div>
<h3><a name="gdb-breakpoints"></a>More on setting breakpoints</h3>
</div>
</div>
</div>
<p>Finally, as mentioned above, gdb has a variety of ways to set         breakpoints.  The example below demonstrates setting         breakpoints at a specific line number and in a function in a         library used by the program.</p>
<pre><tt><tt>144 newren@Miney:~/examples$</tt> <strong>gdb gdb-example</strong>
GNU gdb Red Hat Linux (5.3.90-0.20030710.41rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) <strong><tt>break gdb-example.c:19</tt></strong>
Breakpoint 1 at 0x80483d2: file gdb-example.c, line 19.
(gdb) <strong><tt>break printf</tt></strong>
Function "printf" not defined.
Make breakpoint pending on future shared library load? (y or [n]) <strong><tt>y</tt></strong>

Breakpoint 2 (printf) pending.
(gdb) <strong><tt>run</tt></strong>
Starting program: /data/home/newren/floss-development/developing-with-gnome/examples/debugging/gdb/gdb-example
Breakpoint 1, main () at gdb-example.c:19
19        print_scrambled(good_message);
(gdb) <strong><tt>where</tt></strong>
#0  main () at gdb-example.c:19
(gdb) <strong><tt>cont</tt></strong>
Continuing.

Breakpoint 3, 0x004692a6 in printf () from /lib/tls/libc.so.6
(gdb) <strong><tt>where</tt></strong>
#0  0x004692a6 in printf () from /lib/tls/libc.so.6
#1  0x08048394 in print_scrambled (message=0x80484c9 "Hello, world.")
    at gdb-example.c:8
#2  0x080483dd in main () at gdb-example.c:19
(gdb) <strong><tt>cont</tt></strong>
Continuing.

Breakpoint 3, 0x004692a6 in printf () from /lib/tls/libc.so.6
(gdb) <strong><tt>where</tt></strong>
#0  0x004692a6 in printf () from /lib/tls/libc.so.6
#1  0x08048394 in print_scrambled (message=0x80484ca "ello, world.")
    at gdb-example.c:8
#2  0x080483dd in main () at gdb-example.c:19
(gdb) <strong><tt>delete 3</tt></strong>
(gdb) <strong><tt>cont</tt></strong>
Continuing.
Khoor/#zruog1

Program received signal SIGSEGV, Segmentation fault.
0x08048383 in print_scrambled (message=0x0) at gdb-example.c:8
8           printf("%c", (*message)+i);
(gdb) <strong><tt>quit</tt></strong>
The program is running.  Exit anyway? (y or n) <strong><tt>y</tt></strong>
</tt></pre>
<p>The cont command (shorthand form of &#8220;continue&#8221;) just instructs         gdb to continue running until it either hits another         breakpoint or the program ends.  There where command is         identical to the backtrace command (it is merely an alias).         The delete command removes a breakpoint, given the number of         the breakpoint (the command &#8220;info breakpoints&#8221; can come in         handy in connection with delete).</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://srijan.com.np/2010/08/debugging-in-linux-with-gdb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

