where does gdb put the log file?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite
2












This starts partially from why doesn't gdb like aliases



Now I put the following arguments -



gdb firefox-esr
(gdb) set logging file my-firefox-esr-1802018.log
(gdb) set pagination 0
(gdb) show logging
Future logs will be written to firefox-esr-020818.log.
Logs will be appended to the log file.
Output will be logged and displayed.
(gdb) run --safe-mode


when it crashed I did -



(gdb) bt
(gdb) thread apply all bt


When it finished showing all the threads and the outputs therein I put



(gdb) quit


But now when I am in /home/shirish I don't see that log file. Should I have given the whole path ?







share|improve this question


























    up vote
    2
    down vote

    favorite
    2












    This starts partially from why doesn't gdb like aliases



    Now I put the following arguments -



    gdb firefox-esr
    (gdb) set logging file my-firefox-esr-1802018.log
    (gdb) set pagination 0
    (gdb) show logging
    Future logs will be written to firefox-esr-020818.log.
    Logs will be appended to the log file.
    Output will be logged and displayed.
    (gdb) run --safe-mode


    when it crashed I did -



    (gdb) bt
    (gdb) thread apply all bt


    When it finished showing all the threads and the outputs therein I put



    (gdb) quit


    But now when I am in /home/shirish I don't see that log file. Should I have given the whole path ?







    share|improve this question
























      up vote
      2
      down vote

      favorite
      2









      up vote
      2
      down vote

      favorite
      2






      2





      This starts partially from why doesn't gdb like aliases



      Now I put the following arguments -



      gdb firefox-esr
      (gdb) set logging file my-firefox-esr-1802018.log
      (gdb) set pagination 0
      (gdb) show logging
      Future logs will be written to firefox-esr-020818.log.
      Logs will be appended to the log file.
      Output will be logged and displayed.
      (gdb) run --safe-mode


      when it crashed I did -



      (gdb) bt
      (gdb) thread apply all bt


      When it finished showing all the threads and the outputs therein I put



      (gdb) quit


      But now when I am in /home/shirish I don't see that log file. Should I have given the whole path ?







      share|improve this question














      This starts partially from why doesn't gdb like aliases



      Now I put the following arguments -



      gdb firefox-esr
      (gdb) set logging file my-firefox-esr-1802018.log
      (gdb) set pagination 0
      (gdb) show logging
      Future logs will be written to firefox-esr-020818.log.
      Logs will be appended to the log file.
      Output will be logged and displayed.
      (gdb) run --safe-mode


      when it crashed I did -



      (gdb) bt
      (gdb) thread apply all bt


      When it finished showing all the threads and the outputs therein I put



      (gdb) quit


      But now when I am in /home/shirish I don't see that log file. Should I have given the whole path ?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 8 at 11:06









      Rui F Ribeiro

      35k1269113




      35k1269113










      asked Feb 8 at 10:21









      shirish

      3,26342273




      3,26342273




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          By default the directive set logging file in gdb will write to the current directory.



          So, in your example, the log file would be written to the directory where firefox-esr is located, if the user being used has write rights on that directory.



          So the answer is yes, to write the log file in your home directory, you have to give the whole path to set logging file.



          See gdb backtrace to file for an interesting hack to accomplish your actions:




          alias bt='echo 0 | gdb -batch-silent -ex "run" -ex "set logging
          overwrite on" -ex "set logging file gdb.bt" -ex "set logging on" -ex
          "set pagination off" -ex "handle SIG33 pass nostop noprint" -ex "echo
          backtrace:n" -ex "backtrace full" -ex "echo nnregisters:n" -ex
          "info registers" -ex "echo nncurrent instructions:n" -ex "x/16i
          $pc" -ex "echo nnthreads backtrace:n" -ex "thread apply all
          backtrace" -ex "set logging off" -ex "quit" --args'



          bt $crashing_application




          See also Backtraces with Gentoo






          share|improve this answer





























            up vote
            0
            down vote













            The gdb.txt or custom-log-file file will not be created in pwd always, by gdb. It has to be explicitly specified by executing command 'set logging on' in gdb terminal. Only then the output will be logged.






            share|improve this answer




















              Your Answer







              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "106"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );








               

              draft saved


              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f422765%2fwhere-does-gdb-put-the-log-file%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              4
              down vote



              accepted










              By default the directive set logging file in gdb will write to the current directory.



              So, in your example, the log file would be written to the directory where firefox-esr is located, if the user being used has write rights on that directory.



              So the answer is yes, to write the log file in your home directory, you have to give the whole path to set logging file.



              See gdb backtrace to file for an interesting hack to accomplish your actions:




              alias bt='echo 0 | gdb -batch-silent -ex "run" -ex "set logging
              overwrite on" -ex "set logging file gdb.bt" -ex "set logging on" -ex
              "set pagination off" -ex "handle SIG33 pass nostop noprint" -ex "echo
              backtrace:n" -ex "backtrace full" -ex "echo nnregisters:n" -ex
              "info registers" -ex "echo nncurrent instructions:n" -ex "x/16i
              $pc" -ex "echo nnthreads backtrace:n" -ex "thread apply all
              backtrace" -ex "set logging off" -ex "quit" --args'



              bt $crashing_application




              See also Backtraces with Gentoo






              share|improve this answer


























                up vote
                4
                down vote



                accepted










                By default the directive set logging file in gdb will write to the current directory.



                So, in your example, the log file would be written to the directory where firefox-esr is located, if the user being used has write rights on that directory.



                So the answer is yes, to write the log file in your home directory, you have to give the whole path to set logging file.



                See gdb backtrace to file for an interesting hack to accomplish your actions:




                alias bt='echo 0 | gdb -batch-silent -ex "run" -ex "set logging
                overwrite on" -ex "set logging file gdb.bt" -ex "set logging on" -ex
                "set pagination off" -ex "handle SIG33 pass nostop noprint" -ex "echo
                backtrace:n" -ex "backtrace full" -ex "echo nnregisters:n" -ex
                "info registers" -ex "echo nncurrent instructions:n" -ex "x/16i
                $pc" -ex "echo nnthreads backtrace:n" -ex "thread apply all
                backtrace" -ex "set logging off" -ex "quit" --args'



                bt $crashing_application




                See also Backtraces with Gentoo






                share|improve this answer
























                  up vote
                  4
                  down vote



                  accepted







                  up vote
                  4
                  down vote



                  accepted






                  By default the directive set logging file in gdb will write to the current directory.



                  So, in your example, the log file would be written to the directory where firefox-esr is located, if the user being used has write rights on that directory.



                  So the answer is yes, to write the log file in your home directory, you have to give the whole path to set logging file.



                  See gdb backtrace to file for an interesting hack to accomplish your actions:




                  alias bt='echo 0 | gdb -batch-silent -ex "run" -ex "set logging
                  overwrite on" -ex "set logging file gdb.bt" -ex "set logging on" -ex
                  "set pagination off" -ex "handle SIG33 pass nostop noprint" -ex "echo
                  backtrace:n" -ex "backtrace full" -ex "echo nnregisters:n" -ex
                  "info registers" -ex "echo nncurrent instructions:n" -ex "x/16i
                  $pc" -ex "echo nnthreads backtrace:n" -ex "thread apply all
                  backtrace" -ex "set logging off" -ex "quit" --args'



                  bt $crashing_application




                  See also Backtraces with Gentoo






                  share|improve this answer














                  By default the directive set logging file in gdb will write to the current directory.



                  So, in your example, the log file would be written to the directory where firefox-esr is located, if the user being used has write rights on that directory.



                  So the answer is yes, to write the log file in your home directory, you have to give the whole path to set logging file.



                  See gdb backtrace to file for an interesting hack to accomplish your actions:




                  alias bt='echo 0 | gdb -batch-silent -ex "run" -ex "set logging
                  overwrite on" -ex "set logging file gdb.bt" -ex "set logging on" -ex
                  "set pagination off" -ex "handle SIG33 pass nostop noprint" -ex "echo
                  backtrace:n" -ex "backtrace full" -ex "echo nnregisters:n" -ex
                  "info registers" -ex "echo nncurrent instructions:n" -ex "x/16i
                  $pc" -ex "echo nnthreads backtrace:n" -ex "thread apply all
                  backtrace" -ex "set logging off" -ex "quit" --args'



                  bt $crashing_application




                  See also Backtraces with Gentoo







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Feb 8 at 15:11

























                  answered Feb 8 at 10:56









                  Rui F Ribeiro

                  35k1269113




                  35k1269113






















                      up vote
                      0
                      down vote













                      The gdb.txt or custom-log-file file will not be created in pwd always, by gdb. It has to be explicitly specified by executing command 'set logging on' in gdb terminal. Only then the output will be logged.






                      share|improve this answer
























                        up vote
                        0
                        down vote













                        The gdb.txt or custom-log-file file will not be created in pwd always, by gdb. It has to be explicitly specified by executing command 'set logging on' in gdb terminal. Only then the output will be logged.






                        share|improve this answer






















                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          The gdb.txt or custom-log-file file will not be created in pwd always, by gdb. It has to be explicitly specified by executing command 'set logging on' in gdb terminal. Only then the output will be logged.






                          share|improve this answer












                          The gdb.txt or custom-log-file file will not be created in pwd always, by gdb. It has to be explicitly specified by executing command 'set logging on' in gdb terminal. Only then the output will be logged.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Jul 26 at 13:31









                          Phani

                          11




                          11






















                               

                              draft saved


                              draft discarded


























                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f422765%2fwhere-does-gdb-put-the-log-file%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Popular posts from this blog

                              How to check contact read email or not when send email to Individual?

                              Bahrain

                              Postfix configuration issue with fips on centos 7; mailgun relay