[mythtv] Gdb Woes

Mark Spieth mark at digivation.com.au
Sun Jul 1 05:03:51 UTC 2018


On 7/1/2018 2:28 PM, David Engel wrote:
> On Sun, Jul 01, 2018 at 02:02:25PM +1000, Mark Spieth wrote:
>> On 7/1/2018 12:53 PM, David Engel wrote:
>>> On Sun, Jul 01, 2018 at 10:55:17AM +1000, Mark Spieth wrote:
>>>> On 7/1/2018 2:20 AM, David Engel wrote:
>>>>> Mark,
>>>>>
>>>>> I'm still having issues trying to get gdb to run.  Attached are two
>>>>> log files.  Can you make any sense of them?
>>>>>
>>>>> gdb.log is from running "bash -x ./gdb.sh | tee gdb.log".  The "Can't
>>>>> open socket: Permission denied." look suspicious.
>>>>>
>>>>> logcat.log is from running "adb logcat |& tee logcat.log".  The
>>>>> "Debugger is no longer active" looks suspicious here.
>>>>>
>>>>> David
>>>> did a quick search for "oreo gdbserver" and found this good info
>>>> https://github.com/android-ndk/ndk/issues/447
>>>>
>>>> They found your copy trick (a bit different)
>>>> adb push .../gdbserver /data/local/tmp
>>>> adb shell
>>>> $ cat /data/local/tmp/gdbserver | run-as |org.mythtv.mythfrontend| sh -c
>>>> 'cat > /data/data/|org.mythtv.mythfrontend|/gdbserver'
>>>>
>>>> or do it your way is also fine with dd or the sh -c cat trick. no middle
>>>> man. will also work on any version of android (I think).
>>>> chmod like normal of course is still required.
>>> Using cat with quoted redirection was going to be my next attempt.
>>>
>>>> Key log lines
>>>>
>>>> 06-30 11:10:35.093 27145 27145 W gdbserver: type=1400 audit(0.0:4016): avc: denied { read } for name="stat" dev="proc" ino=4026540912 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:proc_stat:s0 tclass=file permissive=0
>>>>
>>>> + /home/david/android/android-ndk/my-android-toolchain64/bin/gdb -n -x
>>>> so/gdb.setup
>>>> Can't open socket: Permission denied.
>>>>
>>>> Easy way to fix #2 is change USE_IP=0 in gdb.sh and it should work
>>>> (hopefully).
>>> The actual error is different (Connection reset by peer instead of
>>> Permission denied), but still no go.  gdb2.log file attached.
>> looks like mfe was not even started.
>> cant see any mention of gdbserver in logcat output.
> I get a popup stating that mfe is waiting for the debugger to attach.
>
> Might this log be relevant?
>
> 06-30 21:29:05.194 10886 10886 W gdbserver: type=1400 audit(0.0:5110): avc: denied { read } for name="stat" dev="proc" ino=4026540912 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:proc_stat:s0 tclass=file permissive=0
yes. newer gdbserver maybe.
>> Try to reorder the adb forward and the gdbserver start, may be important to
>> have the "adb forward" done first.
>> if that fails,
>> Try changing to target remote to explicitly use localhost
>> Try netstat -tan | grep 5089 to see if adb forward is actually listening on
>> the host.
>> Also check netstat on the shield too after gdbserver is running to make sure
>> its listening on the domain socket.
>> put them in the script to make it easy.
> Tomorrow.
>
Mark


More information about the mythtv-dev mailing list