Forums

Little bug or my fault?

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Little bug or my fault?

Postby relez » Sun Sep 07, 2008 7:39 am

Command line:
cobra 00030.cobra
this works fine, ok

C:\Users\RL\Cobra\bin>cobra 00030.COBRA (uppercase!)
gives:

An unhandled exception has occurred.

Cobra debugging tips:
To get file name and line number information for the stack frames, use:
cobra -debug foo.cobra
To get a post-mortem, HTML-formatted report with more details about your obj
ects:
cobra -debug -exception-report foo.cobra
For even more information, try:
cobra -debug -exception-report -detailed-stack-trace foo.cobra
Or use the abbreviations:
cobra -d -er -dst foo.cobra


Unhandled Exception: System.ComponentModel.Win32Exception: The specified executa
ble is not a valid Win32 application.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startIn
fo)
at System.Diagnostics.Process.Start()
at CommandLine.DoRun(List`1 paths)
at CommandLine.Run(List`1 args)
at CommandLine.Run()
at CobraMain.Main()


I think this couldn't be right output.....
relez
 
Posts: 69

Re: Little bug or my fault?

Postby hopscc » Sun Sep 07, 2008 8:48 pm

Debateable but I'd tend towards user error :) ( if only for relying on all apps to preserve Windows case-preserving-but-insensitive behaviour) :) :) ....

The compiler calculates the exe filename by looking for and removing any '.cobra' extension - what remains is used for the base exe name.
since the filename given uses an upcase extension '.COBRA' the compiled exe filename is .00030.COBRA.exe
the name passed to the .Net Process call to run (after compilation) is 00030.COBRA which through whatever magic checking it does determines that that name isnt an executable
and throws the error.

Note that the executable file exists and can be run after the compiler run directly
Code: Select all
> cobra 00030.COBRA
... error..
> 00030.COBRA.exe
... runs

( I tested this using 100-PrintHelloWorld from HowTo dir)
compiling with lowercase extension (.cobra e.g. 100-PRINTHELLOWORLD.cobra) works fine (naturally)

You can see whats happening in both cases (upper and lower cases) running the compiler with -v option

You're better off using the same case (extensions at least) as described.
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: Little bug or my fault?

Postby relez » Mon Sep 08, 2008 3:05 pm

Interesting. Obviously everything is born by chance :)
C# compiler behaves differently, however, as far as i remember, it doesn't care about filename.cs or filename.CS.
Of course it's a minor question.... ;)
relez
 
Posts: 69

Re: Little bug or my fault?

Postby Charles » Thu Sep 11, 2008 12:40 am

It's a weird issue as ALL CAPS isn't the norm on PCs anymore, but I went ahead and fixed it in development. "foo.COBRA" will compile and run just fine. The extension will be ".exe".

-Chuck
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 105 guests

cron