This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 198154 - Project from Binary File doesn't list a.out as a choice in binary browser (Solaris)
Summary: Project from Binary File doesn't list a.out as a choice in binary browser (So...
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.0
Hardware: PC Solaris
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-27 22:06 UTC by Thomas Preisler
Modified: 2011-05-05 05:56 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
a.out (Mac) (8.77 KB, application/octet-stream)
2011-04-28 22:20 UTC, Thomas Preisler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Preisler 2011-04-27 22:06:44 UTC
OpenSolaris

Use a binary with the name a.out (default Unix name) and try to create a Project from Binary File from this file. It is not listed in the binary browser "Select Binary File" that is one of the steps in the wizard. Feel free to downgrade to P3 as you can type manually it in and it then works.
Comment 1 Thomas Preisler 2011-04-27 22:30:44 UTC
On Mac a.out is also not listed but the *directory* called a.out.dSYM is! It should not list a.out.dSYM as a choice on a Mac.
Comment 2 Alexander Simon 2011-04-28 12:28:53 UTC
fixed, change set:
http://hg.netbeans.org/cnd-main/rev/4cb642c36017
Comment 3 Thomas Preisler 2011-04-28 19:18:13 UTC
Mac: yes, a.out is now in the browser but if you select it, an error message like this is displayed:

File /Users/thp/NetBeansProjects/Aout/a.out not found

The file is there :-).

Also, a.out.dSYM is still a choice on the Mac. It should not.
Comment 4 Alexander Simon 2011-04-28 19:29:40 UTC
Thomas please investigate root cause of problem in Mac.
Comment 5 Thomas Preisler 2011-04-28 22:15:05 UTC
OK, here is what is happening: You read a.out correctly. Since it is compiled like this: "g++ -g welcome.cc", it is using a temp .o file and (I think) you correctly get the name of this .o file and try to read it. It doesn't exist (perhaps been deleted?) and it throws an IO exception with File Not Found. You intercept the IO exception and erroresly assumes it is a.out that is not found but in fact it is the temp .o file. The message in the original IO exception says:

"/var/folders/Ep/EpjGWDtEHbadC3uWH1mBAU++BK+/-Tmp-/ccRe6Uqw.o (No such file or directory)"

Here is stack trace when the original IO exception is thrown:

org.netbeans.modules.cnd.dwarfdump.reader.MyRandomAccessFile.<init>(MyRandomAccessFile.java:62)
org.netbeans.modules.cnd.dwarfdump.FileMagic.<init>(FileMagic.java:60)
org.netbeans.modules.cnd.dwarfdump.Dwarf.<init>(Dwarf.java:85)
org.netbeans.modules.cnd.dwarfdump.Dwarf$MacArchiveIterator.advanceArchive(Dwarf.java:381)
org.netbeans.modules.cnd.dwarfdump.Dwarf$MacArchiveIterator.<init>(Dwarf.java:335)
org.netbeans.modules.cnd.dwarfdump.Dwarf.iteratorCompilationUnits(Dwarf.java:139)
org.netbeans.modules.cnd.dwarfdiscovery.provider.BaseDwarfProvider.sizeComilationUnit(BaseDwarfProvider.java:226)
org.netbeans.modules.cnd.dwarfdiscovery.provider.AnalyzeExecutable.canAnalyze(AnalyzeExecutable.java:218)
org.netbeans.modules.cnd.discovery.wizard.DiscoveryExtension.isApplicableDwarfExecutable(DiscoveryExtension.java:168)
org.netbeans.modules.cnd.discovery.wizard.DiscoveryExtension.isApplicable(DiscoveryExtension.java:123)
org.netbeans.modules.cnd.discovery.wizard.DiscoveryExtension.discoverArtifacts(DiscoveryExtension.java:86)
org.netbeans.modules.cnd.makeproject.ui.wizards.SelectBinaryPanelVisual$5.run(SelectBinaryPanelVisual.java:209)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)

and you catch it at:

org.netbeans.modules.cnd.dwarfdiscovery.provider.BaseDwarfProvider.sizeComilationUnit(BaseDwarfProvider.java:322)
org.netbeans.modules.cnd.dwarfdiscovery.provider.AnalyzeExecutable.canAnalyze(AnalyzeExecutable.java:218)
org.netbeans.modules.cnd.discovery.wizard.DiscoveryExtension.isApplicableDwarfExecutable(DiscoveryExtension.java:168)
org.netbeans.modules.cnd.discovery.wizard.DiscoveryExtension.isApplicable(DiscoveryExtension.java:123)
org.netbeans.modules.cnd.discovery.wizard.DiscoveryExtension.discoverArtifacts(DiscoveryExtension.java:86)
org.netbeans.modules.cnd.makeproject.ui.wizards.SelectBinaryPanelVisual$5.run(SelectBinaryPanelVisual.java:209)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)

Back to you. I can help fixing it if you point me in the right direction. I will attach the a.out. Perhaps that is enough.
Comment 6 Thomas Preisler 2011-04-28 22:17:08 UTC
not a critical bug to fix. Removed fix-in-nb701.
Comment 7 Thomas Preisler 2011-04-28 22:20:16 UTC
Created attachment 108013 [details]
a.out (Mac)
Comment 8 Alexander Simon 2011-04-29 04:03:31 UTC
Thomas please attach folder with build artifacts (all files including a.out.dSYM).
By the way mac executable does not included dwarf information. Discovery try to detect object files which were liked at build time. If object file dos not exist discovery is failed. 
Probably discovery should use another algorithm for finding dwarf information. For example in a.out.dSYM. IMHO it is an enchantment.
Comment 9 Quality Engineering 2011-04-29 04:42:18 UTC
Integrated into 'main-golden', will be available in build *201104290000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/4cb642c36017
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #198154 Project from Binary File doesn't list a.out as a choice in binary browser (Solaris)
Comment 10 Alexander Simon 2011-05-03 13:03:33 UTC
fix for Mac
http://hg.netbeans.org/cnd-main/rev/4b1316d04082
Comment 11 Quality Engineering 2011-05-05 05:56:09 UTC
Integrated into 'main-golden', will be available in build *201105050000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/4b1316d04082
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #198154 Project from Binary File doesn't list a.out as a choice in binary browser (Solaris)