title: debugging assembly code under gdb  | platform linux
body: <p>I am new to debugging an assembly code under gdb.Therefore, I have some question;</p>
  
  <ul>
  <li>How can I run my assembly code (At virtual place ) without <strong>actually</strong> running it ?</li>
  <li><p>If it needs a value, how can I insert a value to see how it works for each case in switch statement?</p>
  
  <p>ex: I couldnot give example on assembly so I give it in c.</p>
  
  <pre><code>    scanf ( "%d",&amp;y);
      while ( y ) {
           ...
           scanf( "%d", &amp;x);
           switch ( x ) {
  
           case 1: ...
           case 2: ...
           case 3: ...
           }
  
       }
  </code></pre></li>
  <li><p>If I need, how can I know what value is stored in a register ?</p></li>
  <li>How can I print out all display to my .txt file ? In other words, assume I have started my program and it runs with no break point and then I want print this display to .txt file. So, I can work on paper. As You know, paper is more powerful than computer :)</li>
  </ul>
  
  <p>I know some of you will say "go and read gdb tutorial or man page".But, I could not find any good tutorials, with  example to explain how a command works. My brain  only works when my eyes see example :)</p>
  
  <p>Platform is Linux 
  Tool     is terminal/console</p>
  
  <p>EDIT : Please give me a good website including good documentation, of course If you know </p>
  
  <p><strong>Give me documentation of "how to [catch] fish", "not how to eat fish"</strong></p>