简体   繁体   中英

How to stop signal SIGPWR, Power fail/restart while debugging xamarin android c++ code in visual studio 2019 on Windows

I am not able to debug anything in my c++ code of xamarin android app.I continously get signal SIGPWR for threads and application breaks on this signal.

I tried to search to solve above issue for my app but i did not find any good answer.after struggling a lot, I was able to fix it. so solution is given below in steps.

  1. Locate gdb.exe on your windows machine. Most probably it would be here:C:\Microsoft\AndroidNDK64\android-ndk-r16b\prebuilt\windows-x86_64\bin

  2. Create a new file with name".gdbinit" in the directory where gdb.exe is.

  3. Open.gdbinit in notepad and add 4 and 5 lines in the file:

  4. set auto-load safe-path /

  5. handle SIGXCPU SIG33 SIG35 SIG36 SIG37 SIG38 SIGPWR nostop noprint

  6. Now create a system Environment variable with name "HOME" and set its value the directory of your.gdbinit. this is same directory where gdb.exe resides.

  7. Restart Visual studio and now these signals will not be there and we can debug c++ code easily.

for more info have a look to below links:

from above links, I could understand better and resolve my issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM