flat assembler
Message board for the users of flat assembler.
Index
> IDE Development > [BUG] Can you reproduce this bug? |
Author |
|
windwakr 17 Feb 2010, 21:28
What exactly is supposed to happen? When I did that, I couldn't assemble anything. Is that the bug?
|
|||
17 Feb 2010, 21:28 |
|
Teehee 17 Feb 2010, 22:48
try this:
This bug gave me a headache these days... |
|||
17 Feb 2010, 22:48 |
|
madmatt 17 Feb 2010, 23:17
bitshifter wrote: I may have found a bug in FASMW IDE I did all that you said above, and it re-compiled without crashing . BUT, when I tried to open another file (instead of trying to re-assemble the main file) I got a crash . Re-did two times with the same result, a crash. So, there certainly a bug somewhere. [EDIT]forgot to add I'm using the latest FASMW package: 1.69.12 [EDIT] [/b]
_________________ Gimme a sledge hammer! I'LL FIX IT! |
|||||||||||
17 Feb 2010, 23:17 |
|
bitshifter 18 Feb 2010, 05:39
Ok, it only happens if main (assigned) file not have focus...
New way to test: 1) Open numerous source files and assign main file to assembler. 2) Click a tab ctrl to view any file but the main one. 3) Modify this file in some way. 4) Close the window (you will be asked to save these changes) 5) Click cancel. 6) Try to assemble the source... FASMW gives focus back to the main (assigned) file and does not assemble. _________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. |
|||
18 Feb 2010, 05:39 |
|
bitshifter 19 Feb 2010, 13:19
Ok, i think i found why this is happening.
Code: wmclose: mov [lparam],MB_DEFBUTTON2 close_window: mov [wparam],0 check_and_exit: mov [ei.header.mask],TCIF_PARAM+TCIF_TEXT mov [ei.header.pszText],name_buffer mov [ei.header.cchTextMax],100h invoke SendMessage,[hwnd_tabctrl],TCM_GETITEM,[wparam],ei or eax,eax jz quit mov esi,[ei.pszpath] invoke SendMessage,[ei.hwnd],EM_CANUNDO,0,0 or eax,eax jz release_path invoke SendMessage,[hwnd_tabctrl],TCM_SETCURSEL,[wparam],0 invoke SendMessage,[hwnd],FM_SELECT,[wparam],0 mov eax,MB_ICONQUESTION+MB_YESNOCANCEL or eax,[lparam] invoke MessageBox,[hwnd],_saving_question,[ei.header.pszText],eax cmp eax,IDCANCEL je finish cmp eax,IDNO je release_path invoke SendMessage,[hwnd],WM_COMMAND,IDM_SAVE,0 or eax,eax jnz finish release_path: or esi,esi jz check_next invoke VirtualFree,esi,0,MEM_RELEASE check_next: inc [wparam] jmp check_and_exit I think the problem is that the memory is freed before the user can cancel. The solution would be to iterate through children checking if dirty or not then to ask user if save when dirty but not to free memory until last which means after the user has chosen to save/quit/cancel I will not provide a fix as TG has his own choice in the matter but i just wanted to show what were my findings in the code... _________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. |
|||
19 Feb 2010, 13:19 |
|
revolution 20 Feb 2010, 03:31
So there appear to be two approaches to follow to fix this problem.
1) After each section of memory is released remove the file from the tab list also. Ideally all the memory allocation/release and tab addition/removal should be done by one common atomic function so as to avoid all these sorts of issues. Or, 2) Produce a dialogue box with the list of all files open and their current dirty statuses. Allow the user to tick/untick things to selectively say which files to save and which to abandon (default could be to have all marked for saving I guess). Then once a single common "save" button is pressed all the actions take place without further user interaction. You can also add "save all" and "save none" buttons along with "cancel" to allow quick global user actions. I also note that some settings in fasmw can affect how files are saved (thinking tab/space expansion here), so even files that are not "dirty" could also be available as options to save. This way you could load a whole set of files, and without editing, but changing a save setting, you could then re-save all and alter the disk image with the new settings. |
|||
20 Feb 2010, 03:31 |
|
bitshifter 20 Feb 2010, 05:50
I think two loops would be more elegant...
Code: clear cancel flag... while(children to process) { if(save was chosen) { save it... } else if(cancel was chosen) { set cancel flag and break out of loop... } } if(cancel flag not set) { while(memory to free) { free memory... } terminate application... } Then it would appear to run normally as intended... |
|||
20 Feb 2010, 05:50 |
|
revolution 12 Apr 2010, 11:55
bitshifter wrote: I think two loops would be more elegant... Code: ;... jmp check_before_exiting mov [wparam],0 release_paths: mov [ei.header.mask],TCIF_PARAM+TCIF_TEXT mov [ei.header.pszText],name_buffer mov [ei.header.cchTextMax],100h invoke SendMessage,[hwnd_tabctrl],TCM_GETITEM,[wparam],ei or eax,eax jz quit mov esi,[ei.pszpath] or esi,esi jz release_next_path invoke VirtualFree,esi,0,MEM_RELEASE release_next_path: inc [wparam] jmp release_paths quit: ;... |
|||
12 Apr 2010, 11:55 |
|
bitshifter 12 Apr 2010, 18:18
Hmm, i test what you say...
Code: release_paths: mov [ei.header.mask],TCIF_PARAM+TCIF_TEXT mov [ei.header.pszText],name_buffer mov [ei.header.cchTextMax],100h invoke SendMessage,[hwnd_tabctrl],TCM_GETITEM,[wparam],ei or eax,eax jz quit mov esi,[ei.pszpath] or esi,esi jz release_next_path invoke MessageBox,0,release_next_path.message,0,0 invoke VirtualFree,esi,0,MEM_RELEASE release_next_path: inc [wparam] jmp release_paths .message db 'Releasing memory...',0 quit: |
|||
12 Apr 2010, 18:18 |
|
bitshifter 13 Apr 2010, 03:50
I fix code?
Code: wmclose: mov [lparam],MB_DEFBUTTON2 close_window: mov [wparam],0 check_before_exiting: mov [ei.header.mask],TCIF_PARAM+TCIF_TEXT mov [ei.header.pszText],name_buffer mov [ei.header.cchTextMax],100h invoke SendMessage,[hwnd_tabctrl],TCM_GETITEM,[wparam],ei or eax,eax ;jz quit ; REMOVE <----------------------------------- jz no_more_children ; INSERT <----------------------------------- mov esi,[ei.pszpath] invoke SendMessage,[ei.hwnd],EM_CANUNDO,0,0 or eax,eax jz check_next invoke SendMessage,[hwnd_tabctrl],TCM_SETCURSEL,[wparam],0 invoke SendMessage,[hwnd],FM_SELECT,[wparam],0 mov eax,MB_ICONQUESTION+MB_YESNOCANCEL or eax,[lparam] invoke MessageBox,[hwnd],_saving_question,[ei.header.pszText],eax cmp eax,IDCANCEL je finish cmp eax,IDNO je check_next invoke SendMessage,[hwnd],WM_COMMAND,IDM_SAVE,0 or eax,eax jnz finish check_next: inc [wparam] jmp check_before_exiting no_more_children: ; INSERT <----------------------------------- mov [wparam],0 release_paths: invoke MessageBox,0,0,0,0 ; INSERT <-------------------------------- mov [ei.header.mask],TCIF_PARAM+TCIF_TEXT mov [ei.header.pszText],name_buffer mov [ei.header.cchTextMax],100h invoke SendMessage,[hwnd_tabctrl],TCM_GETITEM,[wparam],ei or eax,eax jz quit mov esi,[ei.pszpath] or esi,esi jz release_next_path invoke VirtualFree,esi,0,MEM_RELEASE release_next_path: inc [wparam] jmp release_paths quit: ... _________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. |
|||
13 Apr 2010, 03:50 |
|
revolution 13 Apr 2010, 04:26
bitshifter wrote:
|
|||
13 Apr 2010, 04:26 |
|
bitshifter 13 Apr 2010, 05:25
Optional label:
Code: delete_childrens_memory |
|||
13 Apr 2010, 05:25 |
|
Tomasz Grysztar 13 Apr 2010, 08:18
bitshifter wrote: I fix code? |
|||
13 Apr 2010, 08:18 |
|
revolution 13 Apr 2010, 09:11
Tomasz Grysztar wrote: Wasn't it simpler to download the updated package? It's there since yesterday. |
|||
13 Apr 2010, 09:11 |
|
bitshifter 13 Apr 2010, 12:55
Tomasz Grysztar wrote: Wasn't it simpler to download the updated package? It's there since yesterday. It was actually faster to learn/fix code. Also, why this? Code: or eax,eax jz check_done mov esi,[ei.pszpath] ; <-------------------------- WTF? invoke SendMessage,[ei.hwnd],EM_CANUNDO,0,0 or eax,eax jz check_next _________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. |
|||
13 Apr 2010, 12:55 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.