| Summary: | Null Pointer Exception is raised when I open a file in Kernel Source view in Systemtap IDE | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] Linux Tools | Reporter: | Otavio Pontes <obusatto> | ||||||||
| Component: | Systemtap | Assignee: | anithra <anithra> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | akurtakov, obusatto, pmuldoon, wainersm | ||||||||
| Version: | unspecified | ||||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Otavio Pontes
I did some extra tests and the problem doesn't happen when I use an eclipse without cdt installed or when I set the systemtap c editor as the default editor for .c and .h files. Using the eclipse Text Editor also fails. Hardcoding the systemtap c editor for opening c/c++/h files in kernel source browser worked fine for me too. Created attachment 199259 [details]
Using only systemtap editors to open kernel files.
(In reply to comment #2) > Created attachment 199259 [details] > Using only systemtap editors to open kernel files. This is a patch to use only systemtap editors do visualize files from kernel in kernel Source View. This is not the perfect solution, but it works. I couldn't realize how to open files using any other editor. Just as a possiblity : http://wiki.eclipse.org/FAQ_How_do_I_dynamically_register_an_editor_to_handle_a_given_extension%3F . It is possible to register file extentions with an editor, but I think this would override defaults for the CDT. Maybe there's a way to unregister the editor when not in the Systemtap perspective. (In reply to comment #4) > Just as a possiblity : > http://wiki.eclipse.org/FAQ_How_do_I_dynamically_register_an_editor_to_handle_a_given_extension%3F > . It is possible to register file extentions with an editor, but I think this > would override defaults for the CDT. Maybe there's a way to unregister the > editor when not in the Systemtap perspective. Doing this is really messing with the default editors for other perspectives. And that is not good. Not sure if unregistering the Systemtap editors would be a good solution too. What I can do is to get the correct Systemtap editor using IEditorRegistry#findEditor. But to do that I would need to check the file extension in systemtap, and I was avoiding this. Created attachment 203494 [details]
Another approach is to hardcode the supported editors like this.
I think the previous patch ( https://bugs.eclipse.org/bugs/attachment.cgi?id=199259 ) is probably best. Also, it could probably be applid (similarly) in systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/file/OpenFileAction.java:getEditor . (In reply to comment #7) > I think the previous patch ( > https://bugs.eclipse.org/bugs/attachment.cgi?id=199259 ) is probably best. I agree Created attachment 203509 [details]
Systemtap: Using only stp editors to open files in stap perspective
This patch fixes this problem for kernel files and for files opened by the File->Open menu.
Anithra, if the patch is fine with you then I think it should be commited (with iplog set on the patch itself). Thanks Otavio/Roland, |