mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 11:53:42 +01:00 
			
		
		
		
	* WebAssembly debug info: make wasmtime happy by not emitting line info end
sequences for procedures that lack any debug lines emitted previously
This commit is contained in:
		
							parent
							
								
									aba44452f3
								
							
						
					
					
						commit
						beee98e246
					
				| @ -3533,6 +3533,7 @@ implementation | |||||||
|         nolineinfolevel : Integer; |         nolineinfolevel : Integer; | ||||||
|         prevlabel, |         prevlabel, | ||||||
|         currlabel     : tasmlabel; |         currlabel     : tasmlabel; | ||||||
|  |         haslineinfo: Boolean = false; | ||||||
|       begin |       begin | ||||||
| {$ifdef OMFOBJSUPPORT} | {$ifdef OMFOBJSUPPORT} | ||||||
|         if ds_dwarf_omf_linnum in current_settings.debugswitches then |         if ds_dwarf_omf_linnum in current_settings.debugswitches then | ||||||
| @ -3625,6 +3626,7 @@ implementation | |||||||
|                 { line changed ? } |                 { line changed ? } | ||||||
|                 if (lastfileinfo.line<>currfileinfo.line) and ((currfileinfo.line<>0) or (nolineinfolevel>0)) then |                 if (lastfileinfo.line<>currfileinfo.line) and ((currfileinfo.line<>0) or (nolineinfolevel>0)) then | ||||||
|                   begin |                   begin | ||||||
|  |                     haslineinfo:=true; | ||||||
|                     { set address } |                     { set address } | ||||||
|                     current_asmdata.getlabel(currlabel, alt_dbgline); |                     current_asmdata.getlabel(currlabel, alt_dbgline); | ||||||
|                     list.insertbefore(tai_label.create(currlabel), hp); |                     list.insertbefore(tai_label.create(currlabel), hp); | ||||||
| @ -3722,10 +3724,15 @@ implementation | |||||||
|           end; |           end; | ||||||
| 
 | 
 | ||||||
|         { end sequence } |         { end sequence } | ||||||
|         asmline.concat(tai_const.Create_8bit(DW_LNS_extended_op)); |         if haslineinfo or | ||||||
|         asmline.concat(tai_const.Create_8bit(1)); |            { WasmTime doesn't like it when we emit an end sequence without any previous lines } | ||||||
|         asmline.concat(tai_const.Create_8bit(DW_LNE_end_sequence)); |            not (target_info.system in systems_wasm) then | ||||||
|         asmline.concat(tai_comment.Create(strpnew('###################'))); |           begin | ||||||
|  |             asmline.concat(tai_const.Create_8bit(DW_LNS_extended_op)); | ||||||
|  |             asmline.concat(tai_const.Create_8bit(1)); | ||||||
|  |             asmline.concat(tai_const.Create_8bit(DW_LNE_end_sequence)); | ||||||
|  |             asmline.concat(tai_comment.Create(strpnew('###################'))); | ||||||
|  |           end; | ||||||
|       end; |       end; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Nikolay Nikolov
						Nikolay Nikolov