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

Working on new editor enhancements?
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

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

Post 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"
Last edited by skywalk on Wed Apr 20, 2022 7:43 pm, edited 1 time in total.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

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

Post 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 :)
Et cetera is my worst enemy
User avatar
idle
Always Here
Always Here
Posts: 5039
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

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

Post 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
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

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

Post 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   
---------------------------
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
juergenkulow
Enthusiast
Enthusiast
Posts: 544
Joined: Wed Sep 25, 2019 10:18 am

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

Post 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.
Please ask your questions, because switch on the cognition apparatus decides on the only known life in the universe.Wersten :DDüsseldorf NRW Germany Europe Earth Solar System Flake Bubble Orionarm
Milky Way Local_Group Virgo Supercluster Laniakea Universe
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

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

Post 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.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
idle
Always Here
Always Here
Posts: 5039
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

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

Post 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.
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

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

Post 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.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
idle
Always Here
Always Here
Posts: 5039
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

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

Post 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.
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

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

Post 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.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Post Reply