npapi plugin debugging
Asked Answered
C

1

0

What is the best practice to debug a npapi plugin. I am currently developing a plugin with the help of nixysa. I currently debugging printing intermediate values to log file. Is there any better way ?

--Thanks

Crosseyed answered 12/4, 2011 at 21:32 Comment(0)
F
1

Well, I could start out by implying that the first better way is to use FireBreath instead of nixysa, but that would be rude and might give away my bias ;-) Seriously, though, there is nothing wrong with nixysa; I recommend FireBreath simply on the merit that it works on IE as well on windows and has a lot more bugfixes and workarounds to make sure everything works on all browsers and platforms.

There are a lot of suggestions for debugging plugins in general (as in attaching debuggers to them) on the FireBreath wiki that all pretty well apply to any NPAPI plugin.

Getting debugging methods like that working on linux can be particularly a pain, so on linux I usually lean more towards using a logging framework such as log4cplus.

Others may have more suggestions, but it would probably help if we knew exactly which platforms you were targetting; for example, Chrome (I notice that tag on the question) supports a --plugin-startup-dialog option that is invaluable for attaching to the plugin before it starts up due to the multi-process nature of plugins on Chrome. IE and Firefox both have options to disable OOP (out of process) plugins, which makes attaching to them easier.

Ferrocene answered 12/4, 2011 at 22:42 Comment(2)
Thanks for your advice. Its actually a hobby project. So I am concentrating more on functionality than its adaptability to more browsers. And the plugin is for Linux (as me my most friends use Linux). I'll try to take a look into FireBreath and log4cplus.Crosseyed
Well, FireBreath is definitely easier to use than nixysa (IMO); the main advantage nixysa gives you is that you're working lower level so if you need some feature that FireBreath doesn't support it would be easier to add it. That said, FireBreath supports most features that you'd need for most plugins. Good luck! It is possible to get line-level debugging working in linux (start firefox with -g to start it in GDB), but I am not experienced enough with linux dev to be able to tell you more than that.Ferrocene

© 2022 - 2024 — McMap. All rights reserved.