Page 1 of 1

[v6b6CBE] Where is purebasic.c stored during debug?

Posted: Tue Feb 15, 2022 6:11 pm
by skywalk
When I debug with the integrated IDE + C backend, where is the amalgamated purebasic.c file?
Any errors that popup refer to line numbers in that file.
Using the command line compiler does not reproduce the same file due to cross platform limitations.
Ex. icons, resource file, etc.
C:\> c:\purebasic-x64\Compilers\pbcompilerc.exe -c -t "c:\dev\myapp.pb"

Re: [v6b4CBE] Where is purebasic.c stored during debug?

Posted: Tue Feb 15, 2022 8:41 pm
by chi
When compiling, PB creates a folder called PureBasic (followed by a bunch of numbers) in your %temp% directory where all the project files reside, but deletes it immediately afterwards... You have to get creative if you want to intercept these files :)

Re: [v6b4CBE] Where is purebasic.c stored during debug?

Posted: Tue Feb 15, 2022 8:45 pm
by idle
Use my command line tool alter it to print the current directory. With the message requester. Pb creates a temporary folder in your user's temp directory. But you need to interrupt the compilation to see it.
https://www.purebasic.fr/english/viewtopic.php?t=78558

Re: [v6b6CBE] Where is purebasic.c stored during debug?

Posted: Wed Apr 20, 2022 8:14 pm
by skywalk
Ok,
I have another cryptic PB CBE compiler error that references purebasic.c.
I was able to copy C:\Users\me\AppData\Local\Temp\SomeRandomFolder\purebasic.c before it gets deleted. :evil:

But I am not clear how to fix the error since this code works with ASM BE(backend).

Code: Select all

---------------------------
PureBasic - Assembler error
---------------------------
error: 'rr4318' undeclared (first use in this function); did you mean 'rr4319'?
 SYS_ReAllocateArray((v_nf+1),&(*rr4318).f_f);
                                 ^~~~~~
                                 rr4319
purebasic.c:23700:33: note: each undeclared identifier is reported only once for each function it appears in
purebasic.c:23701:87: warning: passing argument 2 of 'PB_GetMapElement' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]
 s_offsets* rr4321=(s_offsets*)PB_GetMapElement(m_mapcal.a,v_rfpdS);
...
                                         ~~~~~~~~^~~~~~
---------------------------
OK   
---------------------------

Re: [v6b6CBE] Where is purebasic.c stored during debug?

Posted: Wed Apr 20, 2022 11:07 pm
by juergenkulow
Could you please use the command line version with --commented and find out in the C code why rr4318 does not exist and raise a ticket at Bugs - C backend.

Re: [v6b6CBE] Where is purebasic.c stored during debug?

Posted: Sat Apr 23, 2022 1:54 pm
by skywalk
I already mentioned the command line does not create the same purebasic.c file?

It really is simpler to not delete it in the 1st place. :?:
Purebasic.c is a critical file given our errors reference unique variables and line numbers within it.

Re: [v6b6CBE] Where is purebasic.c stored during debug?

Posted: Sat Apr 23, 2022 9:17 pm
by idle
What are your compiler options Are you asking it to optimize the code that can cause problems. Are you using array within a map structure. There has been issues with compound structures in prior betas and is that really your variable name rr4138 that strikes me to be a code generated name.

Re: [v6b6CBE] Where is purebasic.c stored during debug?

Posted: Sat Apr 23, 2022 10:31 pm
by skywalk
Yes, rr4138 is autogenerated by PB.
I tried with and without optimizer.
Yes, I have maps holding arrays.
I have an icon and resident file and threaded options. No matter, I cannot match IDE vs cmd line.

Re: [v6b6CBE] Where is purebasic.c stored during debug?

Posted: Sat Apr 23, 2022 11:28 pm
by idle
Try to expand the lookups and sets through intermediate variables and see if that works.
or show us the structure and how it's being addressed in the function so we can try to replicate the bug.

Re: [v6b6CBE] Where is purebasic.c stored during debug?

Posted: Sun Apr 24, 2022 3:21 am
by skywalk
Yes, I think user Russian already reproduced the error in my other post.

The point of this topic is to ease debug of C backend errors that point to purebasic.c.
The error dialog text can be copied to clipboard on windows 10, but it is easier if in a log.