watching my variable at sdcc compiler for pic
Quote from MedTronic on November 26, 2023, 3:06 pmI download the last version SimulIDE-R2056_Win32 to test but i found that i can't see my program variable in the variable list
this is my simple code and its compiled and run ok but as i toled befor i can't see my variable var1 and var2 at the list
- Code:
//--use-non-free -mpic14 -p12f675 -V #define __12F675 #include <pic12F675.h> typedef unsigned int word; word __at 0x2007 __CONFIG = _BODEN_OFF & _CPD_OFF & _CP_ON & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF; char var1; char var2; void delay(int mSec) { unsigned int i,j; for (i = mSec; i>0 ; i--) for (j = 110; j>0 ; j--); } void main(void) { TRISIO = 0x08; ANSEL = 0X00; CMCON = 0x07; /* disable comparators */ GPIO = 0X00 ; while(1) { /* Loop forever */ var1++; var2 +=2; GPIO0 = !GPIO0; delay(500); GPIO1 = !GPIO1; delay(500); GPIO0 = !GPIO0; delay(250); GPIO1 = !GPIO1; delay(250); } }
and this is the debuge window output
-------------------------------------------------------
Starting Debbuger...
-------------------------------------------------------
Executing:
"D:/SDCC/bin/sdcc" --use-non-free -mpic14 -p12f675 -o"D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\" "D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/Blink.c"D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:104:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:172:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:174:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:195:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:197:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:218:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:220:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:241:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:243:Message[1304] Page selection not needed for this device. No code generated.
message: Using default linker script "C:\Program Files\gputils\lkr\12f675_g.lkr".
warning: Relocation symbol "_cinit" [0x0000] has no section. (pass 0)
warning: Relocation symbol "_cinit" [0x0004] has no section. (pass 0)
warning: Relocation symbol "_cinit" [0x001E] has no section. (pass 0)
warning: Relocation symbol "_cinit" [0x0022] has no section. (pass 0)
warning: Relocation symbol "_cinit" [0x0000] has no section. (pass 0)
warning: Relocation symbol "_cinit" [0x0004] has no section. (pass 0)
warning: Relocation symbol "_cinit" [0x001E] has no section. (pass 0)
warning: Relocation symbol "_cinit" [0x0022] has no section. (pass 0)
warning: Relocation of section "UDL_idata_0" failed, relocating to a shared memory location.
warning: Relocation of section "UDL_Blink_0" failed, relocating to a shared memory location.
warning: Relocation of section "UD_Blink_0" failed, relocating to a shared memory location.
warning: Relocation of section "UD_Blink_1" failed, relocating to a shared memory location.
warning: Relocation of section "IDD_idata_0" failed, relocating to a shared memory location.FirmWare Uploaded to p12F675-1(p12F675)
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.hexSearching for variables... 0 variables found
Mapping Flash to Source... 18 lines mapped
Debugger Started
please help
Best regards
MedTronic
I download the last version SimulIDE-R2056_Win32 to test but i found that i can't see my program variable in the variable list
this is my simple code and its compiled and run ok but as i toled befor i can't see my variable var1 and var2 at the list
- Code:
-
//--use-non-free -mpic14 -p12f675 -V #define __12F675 #include <pic12F675.h> typedef unsigned int word; word __at 0x2007 __CONFIG = _BODEN_OFF & _CPD_OFF & _CP_ON & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF; char var1; char var2; void delay(int mSec) { unsigned int i,j; for (i = mSec; i>0 ; i--) for (j = 110; j>0 ; j--); } void main(void) { TRISIO = 0x08; ANSEL = 0X00; CMCON = 0x07; /* disable comparators */ GPIO = 0X00 ; while(1) { /* Loop forever */ var1++; var2 +=2; GPIO0 = !GPIO0; delay(500); GPIO1 = !GPIO1; delay(500); GPIO0 = !GPIO0; delay(250); GPIO1 = !GPIO1; delay(250); } }
and this is the debuge window output
-------------------------------------------------------
Starting Debbuger...
-------------------------------------------------------
Executing:
"D:/SDCC/bin/sdcc" --use-non-free -mpic14 -p12f675 -o"D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\" "D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/Blink.c"
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:104:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:172:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:174:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:195:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:197:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:218:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:220:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:241:Message[1304] Page selection not needed for this device. No code generated.
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.asm:243:Message[1304] Page selection not needed for this device. No code generated.
message: Using default linker script "C:\Program Files\gputils\lkr\12f675_g.lkr".
warning: Relocation symbol "_cinit" [0x0000] has no section. (pass 0)
warning: Relocation symbol "_cinit" [0x0004] has no section. (pass 0)
warning: Relocation symbol "_cinit" [0x001E] has no section. (pass 0)
warning: Relocation symbol "_cinit" [0x0022] has no section. (pass 0)
warning: Relocation symbol "_cinit" [0x0000] has no section. (pass 0)
warning: Relocation symbol "_cinit" [0x0004] has no section. (pass 0)
warning: Relocation symbol "_cinit" [0x001E] has no section. (pass 0)
warning: Relocation symbol "_cinit" [0x0022] has no section. (pass 0)
warning: Relocation of section "UDL_idata_0" failed, relocating to a shared memory location.
warning: Relocation of section "UDL_Blink_0" failed, relocating to a shared memory location.
warning: Relocation of section "UD_Blink_0" failed, relocating to a shared memory location.
warning: Relocation of section "UD_Blink_1" failed, relocating to a shared memory location.
warning: Relocation of section "IDD_idata_0" failed, relocating to a shared memory location.
FirmWare Uploaded to p12F675-1(p12F675)
D:/SimulIDE/SimulIDE-R2056_Win32/examples/Micro/Pic/MedTronic/C_Codes/SDCC/pic12f675/Blink/build\Blink.hex
Searching for variables... 0 variables found
Mapping Flash to Source... 18 lines mapped
Debugger Started
please help
Best regards
MedTronic
Quote from arcachofo on November 26, 2023, 6:06 pmI download the last version SimulIDE-R2056_Win32 to test but i found that i can't see my program variable in the variable list
this is my simple code and its compiled and run ok but as i toled befor i can't see my variable var1 and var2 at the list
That is because the compiler see that those variables are doing nothing in your program, so the compiler "optimizes" it and those variables are removed.
You can try to declare those variables as "volatile", but the compiler might optimize it anyways.
I download the last version SimulIDE-R2056_Win32 to test but i found that i can't see my program variable in the variable list
this is my simple code and its compiled and run ok but as i toled befor i can't see my variable var1 and var2 at the list
That is because the compiler see that those variables are doing nothing in your program, so the compiler "optimizes" it and those variables are removed.
You can try to declare those variables as "volatile", but the compiler might optimize it anyways.