I think I figured it.. the Galileo compiles with "-g" option which I guess produces debug information held within the object file.
Since I was asking the compiler to output to "stream_my_new_name.cpp.o" (instead of "stream.cpp.o" ) this was reflected in the output - but you can't tell because the output file is unreadable in a text editor.
I confirmed this by re-doing my test but in a different sequence..
1. Execute a build in Arduino 2. Find the object file you want - e.g. stream.cpp.o 3. Rename it so it won't be overwritten 4. Execute the the Arduino command line from a shell window using the exact command i.e. don't change any file names at this point 5. Compare the files, they should be same.
Thanks Coding Badly for giving me the hint about timestamps, that got me thinking about the debug info
Good point, I would say the file has more differences than 1 timestamp though, it starts off OK then gets very different. The files are attached to the galileo forum if you want to examine them in a hex viewer. They were produced on a Windows NT machine.
You think with the parser you used for the code it is possible to update the old arduino libraries? http://blog.makezine.com/2011/12/01/arduino-1-0-is-out-heres-what-you-need-to-know/ looking at those rules? I am trying to add an automated installer (it is pretty complete now) but still missing the "old library" update procedures (for now I is just fairy simple regex replacements) but I think I need fancy stuff to understand if replacement is in comments, or anything the coder can do.
I can parse for some of the rules for definate, I tried the 2 below and the parser could pick them up and at least give a report to the user that they need changing if some kind of tool was needed to do that.
The BYTE keyword Serial.print(val, BYTE) To: Serial.write(val); //sends as char
Migrating Wire (I2C) statements Wire.send() To: Wire.write() And change: Wire.receive() To: Wire.read()
I don't know about the problems caused by dervied classes, I would need to examine this e.g.
Return values from write() methods Classes derived from Print must implement a write method to write data to the device that the class supports. The signature of the write method has changed from void to size_t to return the number of characters written. If you have a class derived from Print you need to modify the write method as follows and return the number of characters written (typically 1). Change:
void write To: size_t write
Overall I think it's worth attempting something, the main problem is that I have not validated the Arduino/Wiring syntax completely, but then again doing something like this would go some way toward getting that validation completed.
Can you download Gold Parser Builder http://goldparser.org/builder/files/GOLD-Builder-5.2.0-Setup.zip I can send a compiled grammer file for arduino etc that you can load into it and scan your library source file, from there you can see in a tree structure what is recognised and possible to trap in some kind of conversion tool?
I've been working on some ideas for helping developers switch from BASIC to target code - C/C++/Arduino (and others).
My demo application reverse engineers BASIC code and converts to the selected target code.
To make things simpler, the code is broken down into subroutines automatically and a flowchart is created for each routine.
This way users can either use the flowchart interface or the text editing interface in whichever language they like.
There are plenty of BASIC programmers out there who I reckon would find this a good way to switch to Arduino.
The application uses Gold Parser Builder to define the Source & Target languages http://goldparser.org/ so I don't need to re-code the whole application to include another language. It can currently process a couple of dialects of BASIC (my own which is similar to VB, and PBASIC e.g. Basic Stamp) and can handle a few dialects of C/C++/C#/Java/Arduino.
The IDE uses a database to track the list of available compilers, so users can compile an Arduino application, or they could create a simple C project and the IDE will fire up and link the correct set of files - it should be able to handle ChipKit, Maple - just update the local database.
Here are some videos I uploaded to demo this to a colleague in Singapore, in each case the source code is pasted into the editor and flowcharts/conversions are then done automatically there are more features than this but these are the ones that I think will interest Arduino users?
1. Reverse engineering BASIC into 2 subroutines and generate flowchart(s)
2. Reverse Engineer PBASIC
3. Reverse Engineer BASIC and convert to C style
4. Reverse Engineer Arduino program, draw the flowcharts and convert to BASIC
OK thanks, I'll have to stick with what I have for the moment then, my application needs to be able to scroll through all Arduino versions and directories, users need to be able to install older Arduino versions alongside newer versions, so overwriting the current installation info won't work for me but would be fine for everyone else I guess, cheers, Mike
Can anyone recommend more online sites like these, or good magazines (either online or hard copy) that are known to be popular within the Arduino community? Basically I'm looking for places where newbie Arduino users can upload details of their own projects, or where experienced Arduino developers can write articles relating to best programming practices.
I could google but I'd really like to hear from members of this forum first?
Thanks for the screenshot, I need all installed versions not just the latest, when you run your setup for the next version of Arduino (maybe 1.0.1.a or something) will it produce a second set of data as per the first screenshot, or will it overwrite that information? If it produces a second set of data for 1.0.1.a then that should be ok for me. I can see why you would want to avoid writing to the registry, it is not something I do often myself.
Thanks for the info, I'm on my laptop so can't check the key I was writing to exactly, but basically I was storing the arduino IDE version as the key and the exectable path for arduino.exe for that version