[mythtv-commits] Ticket #4710: Run mythfrontend and mythbackend through gdb under win32

MythTV mythtv at cvs.mythtv.org
Tue Feb 19 06:59:19 UTC 2008


#4710: Run mythfrontend and mythbackend through gdb under win32
-----------------------------------------------+----------------------------
 Reporter:  Jeff Black <jmblack256 at gmail.com>  |       Owner:  ijr    
     Type:  patch                              |      Status:  new    
 Priority:  trivial                            |   Milestone:  unknown
Component:  contrib                            |     Version:  head   
 Severity:  low                                |     Mlocked:  0      
-----------------------------------------------+----------------------------
 These scripts apply only to Win32 builds and should if included in SVN be
 copied to the same directory as the binaries mythfrontend.exe and
 mythbackend.exe. If these prove useful the perl script should be able to,
 one day, move these around as part of its 'install'

 According to http://www.mythtv.org/docs/mythtv-HOWTO-22.html#ss22.2
 GDB should be run using a gdbcommands file. This runs mythfrontend or
 mythbackend under GDB with the recommended options. Hopefully someone
 finds this useful.

 {{{
 Index: contrib/Win32/debug-mythbackend.cmd
 ===================================================================
 --- contrib/Win32/debug-mythbackend.cmd (revision 0)
 +++ contrib/Win32/debug-mythbackend.cmd (revision 0)
 @@ -0,0 +1,58 @@
 + at Echo off
 +::
 +:: Script to run mythbackend through gdb (easily?)
 +:: There is likely a more efficient way of doing this,
 +:: but we have to start somewhere.
 +::
 +Echo COMMENTS: --------------------------------------
 +Echo COMMENTS: This script is used for gathering backtraces using gdb
 +Echo COMMENTS: See: http://www.mythtv.org/docs/mythtv-
 HOWTO-22.html#ss22.2
 +Echo COMMENTS: See: http://www.mythtv.org/wiki/index.php/Windows_Port
 +Echo COMMENTS: --------------------------------------
 +Echo.
 +::
 +:gdbcommands
 +::
 +:: Check for and Create if needed the .\gdbcommands.txt
 +::
 +:: syntax taken from [ http://www.mythtv.org/docs/mythtv-
 HOWTO.html#toc22.2 ]
 +::
 +if not exist ./gdbcommands.txt (
 +       echo handle SIGPIPE nostop noprint > .\gdbcommands.txt
 +       echo handle SIG33 nostop noprint >> .\gdbcommands.txt
 +       echo set logging on >> .\gdbcommands.txt
 +       echo set pagination off >> .\gdbcommands.txt
 +       echo set args -l myth.log --noupnp --nosched --nojobqueue
 --nohousekeeper --noautoexpire -v all >> .\gdbcommands.txt
 +       echo run >> .\gdbcommands.txt
 +       echo thread apply all bt full >> .\gdbcommands.txt
 +       echo set logging off >> .\gdbcommands.txt )
 + at Echo off
 +
 +Echo COMMENTS: --------------------------------------
 +Echo COMMENTS: Clearing old gdb.txt before running gdb again.
 +Echo COMMENTS: --------------------------------------
 +Echo.
 +::
 +:: add current data/time to gdb.txt
 +:: will this be a bad idea? who knows? =)
 +::
 +date /t > .\gdb.txt
 +time /t >> .\gdb.txt
 +
 +:gdb
 +::
 +:: gdb should be in the path.
 +::
 +Echo COMMENTS: --------------------------------------
 +Echo COMMENTS: If you need to add any switches to mythbackend edit
 gdbcommands.txt
 +Echo COMMENTS: see: "mythbackend.exe --help" for options
 +Echo COMMENTS: --------------------------------------
 +Echo.
 +Echo COMMENTS: --------------------------------------
 +Echo COMMENTS: Starting: gdb
 +Echo COMMENTS: --------------------------------------
 +gdb .\mythbackend.exe -x .\gdbcommands.txt
 +
 +Echo.
 +Echo The backtrace can be found in .\gdb.txt
 +Echo.
 \ No newline at end of file
 Index: contrib/Win32/debug-mythfrontend.cmd
 ===================================================================
 --- contrib/Win32/debug-mythfrontend.cmd        (revision 0)
 +++ contrib/Win32/debug-mythfrontend.cmd        (revision 0)
 @@ -0,0 +1,58 @@
 + at Echo off
 +::
 +:: Script to run mythfrontend through gdb (easily?)
 +:: There is likely a more efficient way of doing this,
 +:: but we have to start somewhere.
 +::
 +Echo COMMENTS: --------------------------------------
 +Echo COMMENTS: This script is used for gathering backtraces using gdb
 +Echo COMMENTS: See: http://www.mythtv.org/docs/mythtv-
 HOWTO-22.html#ss22.2
 +Echo COMMENTS: See: http://www.mythtv.org/wiki/index.php/Windows_Port
 +Echo COMMENTS: --------------------------------------
 +Echo.
 +::
 +:gdbcommands
 +::
 +:: Check for and Create if needed the .\gdbcommands.txt
 +::
 +:: syntax taken from [ http://www.mythtv.org/docs/mythtv-
 HOWTO.html#toc22.2 ]
 +::
 +if not exist ./gdbcommands.txt (
 +       echo handle SIGPIPE nostop noprint > .\gdbcommands.txt
 +       echo handle SIG33 nostop noprint >> .\gdbcommands.txt
 +       echo set logging on >> .\gdbcommands.txt
 +       echo set pagination off >> .\gdbcommands.txt
 +       echo set args -l myth.log --noupnp --nosched --nojobqueue
 --nohousekeeper --noautoexpire -v all >> .\gdbcommands.txt
 +       echo run >> .\gdbcommands.txt
 +       echo thread apply all bt full >> .\gdbcommands.txt
 +       echo set logging off >> .\gdbcommands.txt )
 + at Echo off
 +
 +Echo COMMENTS: --------------------------------------
 +Echo COMMENTS: Clearing old gdb.txt before running gdb again.
 +Echo COMMENTS: --------------------------------------
 +Echo.
 +::
 +:: add current data/time to gdb.txt
 +:: will this be a bad idea? who knows? =)
 +::
 +date /t > .\gdb.txt
 +time /t >> .\gdb.txt
 +
 +:gdb
 +::
 +:: gdb should be in the path.
 +::
 +Echo COMMENTS: --------------------------------------
 +Echo COMMENTS: If you need to add any switches to mythfrontend edit
 gdbcommands.txt
 +Echo COMMENTS: see: "mythbackend.exe --help" for options
 +Echo COMMENTS: --------------------------------------
 +Echo.
 +Echo COMMENTS: --------------------------------------
 +Echo COMMENTS: Starting: gdb
 +Echo COMMENTS: --------------------------------------
 +gdb .\mythfrontend.exe -x .\gdbcommands.txt
 +Echo.
 +Echo The backtrace can be found in .\gdb.txt
 +Echo.
 +

 }}}

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/4710>
MythTV <http://svn.mythtv.org/trac>
MythTV


More information about the mythtv-commits mailing list