[mythtv] howto? gdb trace

Steven Adeff adeffs.mythtv at gmail.com
Mon Feb 6 21:45:55 UTC 2006


On 2/6/06, Stuart Auchterlonie <stuarta at squashedfrog.net> wrote:
> On Mon, Feb 06, 2006 at 04:22:01PM -0500, Steven Adeff wrote:
> > On 2/5/06, Stuart Auchterlonie <stuarta at squashedfrog.net> wrote:
> > > On Sat, Feb 04, 2006 at 12:39:16PM -0500, Steven Adeff wrote:
> > > >
> > > > ok, great. Another question... Is there a way to control gdb through
> > > > ssh? I have a dedicated myth machine that I want to run this on,
> > > > theres no keyboard attached, and if its possible to do the gdb through
> > > > ssh (while still have it display on the tv as normal), it would be
> > > > prefered, if not, i can move my keyboard from my other computer, I'd
> > > > just rather not if possible.
> > > >
> > >
> > > The best way to do the debugging in this case is to startup
> > > the frontend or backend as normal and attach gdb to the running
> > > process. In this case gdb is invoked as
> > >
> > > gdb /usr/local/bin/mythfrontend <pid>
> > >
> > > then just 'cont' and the process will keep executing.
> > >
> > > you may need to be root.
> > >
> > >
> > > I've found this works very well and even avoids the need to
> > > ignore sig 33 etc etc....
> > >
> > >
> > > Stuart
> >
> > running:
> > gdb /usr/local/bin/mythbackend -x ~/.gdbcommands-local
> >
> > when I try to go into liveTV I get:
> >
> > /root/.gdbcommands-local:6: Error in sourced command file:
> > thread_db_get_info: cannot get thread info: generic error
> >
> > .gdbcommands-local is the gdbcommands file as
> > http://www.mythtv.org/docs/mythtv-HOWTO-22.html#ss22.2
> > shows it.
>
> That as documented is for starting up the program under gdb.
>
> My instructions are for the alternative way which is to ATTACH
> gdb to a RUNNING program. Once you attach gdb you have to

right, my question was regarding running mythbackend from the CLI via
an ssh connection (which I've done before to look at log output in
realtime with out issue).

> tell the program to continue by issuing 'cont' and then wait
> for it to segfault.
>
> Then you can follow through with the other commands mentioned ie.
> set logging on
> set pagination off
> thread apply all bt full
> set logging off

ok, so I can't use "gdb /usr/local/mythfrontend <pid> -x
.gdbcommands-remote" with .gdbcommands-remote containing those lines?

which is what I've been doing, and except for the fact that
mythfrontend hasn't crashed yet, seems to be working...

> > and obviously, since running mythfrontend with gdb attached I haven't
> > had it crash during tv playback, of course what prompted me to try was
> > it crashing ~10mins before attaching gdb...
> >
>
> Sometimes you have to try harder with it running under gdb :-/
> It happens to me as well... Such is life...

haha, considering I don't know why it was crashing to begin with that
would make it really hard...

having a script so that I could always have gdb run with my
auto-logging in of mythfrontend and when it crashes have gdb write its
logs etc for my to look through would be nice, but it doesn't look
like gdb can be automated that way. so for now I'll have to explain to
the g/f that I'm doing all this so I can help you guys fix the random
crashing while we watch tv...

--
Steve


More information about the mythtv-dev mailing list