N00b question; Need help with CodeWarrior for RVDS v2.2 (ARM Dev. Suite)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

N00b question; Need help with CodeWarrior for RVDS v2.2 (ARM Dev. Suite)

6,289件の閲覧回数
Shanks
Contributor I
How do I get CodeWarrior for RVDS (v.2.2) to save the Error and Warning information out to a file, when running it unattended, from command line arguments? To be specific, as part of my company's automated test process we use Automated Build Studio to schedule nightly automated builds of our ARM code. CodeWarrior for RVDS is invoked to build the project using the following command-line argument:

  IDE.exe [projectfile.mcp] /r /b /c /q

This builds the project then quits. Then the automated build utility emails the pass or fail status to our engineers.  However, the only information that CodeWarrior for RVDS seems to return via stdOut, is a single digit indicating success or failure. If it fails to build because of a compiler or linker error it might return "8" for example, indicating that there was a build failure -- this is certainly not enough information for our engineers.
 
Unfortunately in this case I can't use "File=>Save A Copy As..." to save the detailed Errors and Warnings out to a file, since this is meant to be an automated process.   I'm sure there's a simple solution that I've overlooked... maybe the error&warning details are already automatically saved somewhere...?  Any ideas?
ラベル(1)
0 件の賞賛
返信
13 返答(返信)

2,678件の閲覧回数
Shanks
Contributor I
Ok, so I discovered that adding the following command-line argument to the armcc.exe compiler utitlity...
   --errors=C:\errors.txt

...essentially redirects the compiler's error and warning info to the specified file ("errors.txt" ). However, when I use this argument within the context of CodeWarrior's IDE (i.e. by adding the command into the "Equivalent Command Line" window in the target settings dialog) and then attempt to build the project, I get the following behavior:

Every time it attempts to compile a new file from the project, it overwrites the errors.txt file with the new error information. So basically, my errors.txt file ends up containing only the information for the last .cpp file compiled <sigh>. So close, but no cigar.

So is there another way?  Even if I could get the IDE to quit compiling on the first discovery of an error, that might be acceptable.   But I can't even find an option to do that...


Message Edited by Shanks on 2008-10-02 10:11 PM
0 件の賞賛
返信

2,678件の閲覧回数
CrasyCat
Specialist III
Hello
 
Compiler delivered on RVDS (v.2.2) is a ARM product.
the option -errors is an option of the ARM compiler, so I would recommend you to post your question to the ARM forum.(http://forums.arm.com/).
 
There are high probability that you can get an answer there
Thanks for your understanding
 
CrasyCat
0 件の賞賛
返信

2,678件の閲覧回数
Shanks
Contributor I
Okay, thanks.  Actually the "--errors" compiler option was just a tangent though -- I'll ask it in the ARM forums, but I'd still like to pose my initial question here; Is there a way I can get the CodeWarrior IDE (it looks like version 5.6.1.1592) to dump the detailed errors and warnings out to a file when running it unattended? 
 
The CodeWarrior IDE seems perfectly capable of parsing and displaying the detailed error messages in a window, and it even allows you to save them to a file.  But you still have to be physically present to select "File=>Save to File..." from the menu.  There must be another way, because I can't believe that such a basic functionality wouldn't be supported.  I also can't believe that nobody else has pointed this out.
0 件の賞賛
返信

2,678件の閲覧回数
CrasyCat
Specialist III
Hello
 
This is possible through Windows COM automation only.
 
I am not aware of what ARM is delivering with RVDS software, but in CodeWarrior installers, we have a manual called
 "IDE_5.7_Automation_Guide.pdf" or "IDE_5.9_Automation_Guide.pdf", where you can find an example of doing that in chapter "Microsoft COM Automation", section "Displaying IDE Messages".
 
I have seen that with IDE V5.7 and V5.9.
I have no clue if ARM is providing that ref. manual.
 
CrasyCat
0 件の賞賛
返信

2,678件の閲覧回数
Shanks
Contributor I
No, that document wasn't included with my version and I don't seem to have access to it. 
 
Any chance you could give me some relevant extracts from the documentation, just to get me pointed in the right direction?  I suspect the same principles from the documents you mentioned, would apply to the version I'm using...
 
 
 
 
0 件の賞賛
返信

2,678件の閲覧回数
J2MEJediMaster
Specialist I
These links point to the manuals in question:

The Automation Guide: http://www.freescale.com/files/soft_dev_tools/doc/user_guide/IDE_5.6_Automation_Guide.pdf

Extending the IDE: http://www.freescale.com/files/soft_dev_tools/doc/user_guide/EXTENDINGIDE.pdf

Good luck, and HTH.

---Tom



0 件の賞賛
返信

2,678件の閲覧回数
Shanks
Contributor I
Thanks!  Okay, I'm so close to being able to perform this task using the DoMenu VBScript directive referenced in the Automation Guide.  The problem is, I can't find the command ID's!  the Automation Guide says that to get the command ID's I need to reference the file CodeWarriorCommandNumbers.h, located in \(Codewarrior SDK)\COM.  Unfortunately I don't have this file anywhere on my system, nor do I have the aformentioned directory.
 
Could someone provide the command ID's from that file?
 
0 件の賞賛
返信

2,678件の閲覧回数
J2MEJediMaster
Specialist I
Here's the file in question, attached to this posting. I must warn you that there are several variants of the CodeWarrior IDE (yeah, it's a support headache, but there it is), and the ARM variant might not support automation. However, hopefully you've got enough information now to give it a try. Let me know if it works out.

---Tom
0 件の賞賛
返信

2,678件の閲覧回数
Shanks
Contributor I
Much appreciated Tom.  I'll give it a try.
 
In the mean time I had a look at the IDE internals through Microsoft's OLE/COM Object Viewer utility, and found a method called "SaveACopyAs" from the ICodeWarriorTextDocument interface, which also looks like it might do the trick.  So now I've got options.  I'm not sure what the VBScript convention is for actually calling this method (seriously, I'm about as new to programming as Sarah Palin is to Washington) but I'm sure I'll find it in an example somewhere. 
 
I suspect it's as simple as typing "ICodeWarriorTextDocument.SaveACopyAs([file path])", but if somebody were to spell it out for me in the mean time, I'm not too proud to copy and paste. :smileywink:
 
I'll post the results if I can get this thing working.  I'm sure it will be useful to somebody out there...
0 件の賞賛
返信

2,678件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
I doubt that the error messages are in a ICodeWarriorTextDocument, I think this interface is for text files only.
So if you want to get the error messages and you have the
CodeWarrior.CodeWarriorApp, then you first have to open the project, in the project find the build target,
then build the build target which returns a list of messages, then by exploring the messages you get to the individual errors.

Here's a very probably not working, not complete sample of how this looks like in perl.
With vbs its the same methods called with another syntax.

Just thought of the sample in HCS12 V4.7, could be this is what you are looking for.
I just zipped
"C:\Program Files\Freescale\CodeWarrior for HCS12 V4.7\(CodeWarrior_Examples)\Scripting\VBS"

Maybe you are lucky and the script for IDE 5.9 just works with your 5.6 ARM ide, I don't know.

Daniel

Code:
use Win32::OLE;...$CW = Win32::OLE->new("CodeWarrior.CodeWarriorApp");$project = $CW->OpenProject($projpath, 1, 0, 1); $target = $project->FindTarget("$targetname");my $messages = $target->BuildAndWaitToComplete();if ($messages->ErrorCount > 0){      my $errors = $messages->Errors();

 


0 件の賞賛
返信

2,678件の閲覧回数
Shanks
Contributor I
Aha!!! This VBScript sample works, and with a few tweaks it will do exactly what I want.  Thank you!
 
***Edit*** Wait a sec... I just discoverd that with the following lines, the SaveACopyAs method does actually work...
 
   set textDocument = codewarrior.OpenUntitledTextDocument()
   textDocument.SaveACopyAs("c:\errors.txt")
 
This could be a much simpler way of doing it -- the sample .vbs code parses its own errors and warnings, which seems redundant when CodeWarrior does its own.
Unfortunately, OpenUntitledTextDocument() only returns a handle to an empty text document.  What I need is the handle to the Errors & Warnings doc.  Any ideas how to get that?


Message Edited by Shanks on 2008-10-07 09:14 PM
0 件の賞賛
返信

2,678件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
No, I would not expect that there is a way to get a text document interface from the Errors and Warnings window. If something is not a text document, it would be surprising that it offers a text document API.

Daniel

0 件の賞賛
返信

2,678件の閲覧回数
Shanks
Contributor I
Yeah, I'm starting to get the distinct impression that this Errors & Warnings document really doesn't want to be saved out to a file. 
 
I came close though... I managed to get a handle to the ICodeWarriorDocument object for the Errors & Warnings window, which provides methods I can use to manipulate the window in many ways; I can re-size it, close it, get its title, and I can even call the Save method on it (although I have no idea what that would do). 
 
Then I discovered that I can get a handle to an IFileSpec interface object, which provides methods that would allow me to specify a file name and path, so that subsequently calling the ICodeWarriorDocument::smileyfrustrated:ave() method would theoretically let me save it out to a file. Finally!  But, big surprise, it won't let me get the IFileSpec interface for this window; when I try to call ICodeWarriorDocument::FileSpec, it returns the message "Object does not support this operation".  I take this to mean that the Errors & Warnings window explicitely dis-allows this operation being performed on it.
 
Oh well, I can just as easily use the provided example code to parse my own error/warning info out to a file.
0 件の賞賛
返信