![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
So I'm trying to figure out a way to see if we have any uncompiled code on our D3 (unix) system. My first thought is to see if there is a way to get the compiled bytes existing and checksum against a new compile to see if there is a change. Second was a hope of an uncompile option which I don't see. Third option would be if there is a way to see the last filed date. Then I could compare that to the LIST-OBJ output and narrow down when a change could have happened. I email the old files to myself now but there is a lot of history to go back over so a quicker way would help. A) How do i go about reading the raw frame data if the first option is possible? B) Any other thoughts on ways I could do this? Going forward I'm going to add a CALLX in the dictionary and capture a copy of the old version so I can follow differences/dates. |
#3
| |||
| |||
|
|
So I'm trying to figure out a way to see if we have any uncompiled code on our D3 (unix) system. My first thought is to see if there is a way to get the compiled bytes existing and checksum against a new compile to see if there is a change. Doesn't look good; |
#4
| |||
| |||
|
|
"Sean" *wrote> So I'm trying to figure out a way to see if we have any uncompiled code on our D3 (unix) system. My first thought is to see if there is a way to get the compiled bytes existing and checksum against a new compile to see if there is a change. Doesn't look good; you could __maybe__ look at using * *DUMP *on what you think are the frames the compiled program lives in, but who really knows what tricky exceptional cases exist on how d3 organizes the frames used, or maybe have semirandom padding in the frames, or subdivides frames to hold parts of more than one compiled program? You likewise could scavenge the binary from a pseudo-floppy t-dump of dict myfile myprog * *but again, there may be semirandom padding say at the end of the t-dump to make up some preferred buffer size, or as part of a 'marker' string between items of a t-dump, or to signal an 'end-of-file' mark at end of t-dump regardless of buffer sizing. Dunno, just haven't tried it, myself... {T-dumps don't truncate output linux file to actual data size, so before you set-device that 'tape', do * echo hi > /tmp/pickbu1 or whatever to truncate it. *Or rm it then touch it. Assume any dict item with * LIST ... SIZE smaller than say 4008 bytes is not a compiled program. |
#5
| |||
| |||
|
|
Here is what I tried yesterday From the D3 refman c/bytes Displays attribute 11 of compiled binary items through the list-obj TCL command. This is the number of bytes of object code. It is also available to AQL. This attribute holds the number of bytes of the actual compiled object code within the frames that hold the binary item. This information is useful to estimate the number of frames that are necessary to FlashBASIC compile standard object code. This is typically 4 times the size in bytes, but is dependent on implementation, optimization level and related options, such as f. This byte count does not include the symbol table, FlashBASIC code or the size of the compile date-time stamp. I ran this on the existing file that contains the code. I then copied that file and recompiled everything in a new file. Commands SORT DICT <FILE> C/BYTES SORT DICT <COPIEDFILE> C/BYTES Wrote up a quick app that ran these and dumped out: Program name + Bytes for each list. Copied into excel. The compiled bytes on all the program names seemed to match up. I think this means we're okay unless someone can tell me otherwise. I would assume that any program change made would have either added or removed characters so the byte count would be different on a change. On Nov 1, 9:43*am, "Frank Winans" <fwin... (AT) sbcglobal (DOT) net> wrote: "Sean" *wrote> So I'm trying to figure out a way to see if we have any uncompiled code on our D3 (unix) system. My first thought is to see if there is a way to get the compiled bytes existing and checksum against a new compile to see if there is a change. Doesn't look good; you could __maybe__ look at using * *DUMP *on what you think are the frames the compiled program lives in, but who really knows what tricky exceptional cases exist on how d3 organizes the frames used, or maybe have semirandom padding in the frames, or subdivides frames to hold parts of more than one compiled program? You likewise could scavenge the binary from a pseudo-floppy t-dump of dict myfile myprog * *but again, there may be semirandom paddingsay at the end of the t-dump to make up some preferred buffer size, or as part of a 'marker' string between items of a t-dump, or to signal an 'end-of-file' mark at end of t-dump regardless of buffer sizing. Dunno, just haven't tried it, myself... {T-dumps don't truncate output linux file to actual data size, so before you set-device that 'tape', do * echo hi > /tmp/pickbu1 or whatever to truncate it. *Or rm it then touch it. Assume any dict item with * LIST ... SIZE smaller than say 4008 bytes is not a compiled program. |
#6
| |||
| |||
|
|
"Sean" wrote So I'm trying to figure out a way to see if we have any uncompiled code on our D3 (unix) system. My first thought is to see if there is a way to get the compiled bytes existing and checksum against a new compile to see if there is a change. Doesn't look good; |
#7
| |||
| |||
|
|
"Frank Winans" wrote !mkdir /tmp/.DICT copy myfile myprog to: (unix:/tmp compile unix:/tmp myprog Argh! Still not good enough, because the resulting |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
I'm not sure that the suggestion that follows will satisfy your goal, but here is what I did on our recent migration to Reality, from D3/NT. On D3, we had "compile-catalog" verb, which would do both the compile and the catalog (of a "clean" compile, anyway). Reality had individual COMPILE / BASIC / CATALOG verbs, but not the "combo" verb. Besides, I wanted to have some history of my compile/catalog activity. My solution was to write a simple "shell", a BASIC program that I named "C-C". I also created a PROGRAM.CATALOG file for tracking history. The program, "C-C", used SENTENCE (a form of the TCL command in D3 basic) to disect the command being fed to C-C. And, I require a full- path (standard syntax ACCOUNTNAME,FILENAME, PROGRAMNAME) in the syntax of the command, thus assuring all programs are compiled and cataloged with full-path. Within C-C, I execute the COMPILE command with the fully-pathed program, and CAPTURE the "errmsg". If the "errmsg" indicates a "clean compile", I move to the CATALOG of the same full path. |
|
Jim Cronin Kittery Trading Post |
#10
| |||
| |||
|
|
JJCSR wrote: I'm not sure that the suggestion that follows will satisfy your goal, but here is what I did on our recent migration to Reality, from D3/NT. On D3, we had "compile-catalog" verb, which would do both the compile and the catalog (of a "clean" compile, anyway). * Reality had individual COMPILE / BASIC / CATALOG verbs, but not the "combo" verb. * *Besides, I wanted to have some history of my compile/catalog activity. * My solution was to write a simple "shell", a BASIC program that I named "C-C". * I also created a PROGRAM.CATALOG file for tracking history. The program, "C-C", used SENTENCE (a form of the TCL command in D3 basic) to disect the command being fed to C-C. * And, I require a full- path (standard syntax ACCOUNTNAME,FILENAME, *PROGRAMNAME) in the syntax of the command, thus assuring all programs are compiled and cataloged with full-path. * *Within C-C, I execute the COMPILE command with the fully-pathed program, and CAPTURE the "errmsg". * *If the "errmsg" indicates a "clean compile", I move to the CATALOG of the same full path. Jim - Good for you! *I have a program called WED.COMPILE that does exactly what you describe above, called from AccuTerm wED (Windows Editor). *I use this to do a C-C on all platforms, flash-compile in D3, etc. *It seems whenever I suggest here that people create verb overloads like this that people scream from the rafters about how terrible that is and how such things should come from the vendor. (Ignore for a moment how many convenience functions like this Do come from the vendors but people don't bother to read the documentation to find them. *ahem*) *This is the very nature of the Linux platform which people pretend to love so much, and yet somehow for Pick it's not acceptable. *Use it and abuse it, I say! [snip] Jim Cronin Kittery Trading Post Thanks, Tony: |
![]() |
| Thread Tools | |
| Display Modes | |
| |