I suspect it is a quite easy code? Can you show a code example?
Well, at least for me its definitely not simple code. Its an open source remake of Abuse game. Code sample at the end of the post (its the function I wanted to debug)
Can you post the build log from the build log tab?
Can you enable full debug logging in settings->debugger->common->full debug log and post the output from the debug log tab?
Its not possible now. Yesterday I gave up with code::blocks and fired up gdb (with the binary built up by code::blocks) And all the variables were visible fine.
And today I needed to debug another piece of code and having code::blocks still open I forgot about its debugging strangeness so I fired debugger again. This time I can see the variables.
But if the strangeness comes back, I will post the full logs.
Thanks
nfs_file::nfs_file(char const *filename, char const *mode)
{
local=NULL;
nfs_fd=-1;
int local_only=0;
char const *s=mode;
for (; *s; s++) // check to see if writeable file, if so don't go through nfs
if (*s=='w' || *s=='W' || *s=='a' || *s=='A')
local_only=1;
char name[256], *c;
char const *f = filename;
c = name;
while (*f) { *c=*(f++); *c=toupper(*c); c++; } *c=0;
if (strstr(name,"REGISTER"))
local_only=1;
if (net_crcs && !local_only)
{
int fail1,fail2,fail3=0;
char const *local_filename = filename;
if (filename[0]=='/' && filename[1]=='/')
{ local_filename+=2;
while (*local_filename && *local_filename!='/') local_filename++;
local_filename++;
}
int remote_file_num=net_crcs->get_filenumber(local_filename);
uint32_t remote_crc=net_crcs->get_crc(remote_file_num,fail2);
if (!fail2)
{
int local_file_num=crc_manager.get_filenumber(local_filename);
uint32_t local_crc=crc_manager.get_crc(local_file_num,fail1);
if (fail1)
{
bFILE *fp=new jFILE(local_filename,"rb");
if (!fp->open_failure())
{
local_crc=crc_file(fp);
crc_manager.set_crc(local_file_num,local_crc);
} else fail3=1;
delete fp;
}
if (!fail3)
{
if (local_crc==remote_crc)
local_only=1;
}
}
}
local_only = 1;
if (local_only)
{
local=new jFILE(filename,mode);
if (local->open_failure()) { delete local; local=NULL; }
}
else
{
char nm[256];
strcpy(nm,filename);
nfs_fd=NF_open_file(nm,mode);
if (nfs_fd==-2)
{
local=new jFILE(nm,mode);
if (local->open_failure()) { delete local; local=NULL; }
nfs_fd=-1;
}
}
}
Edit:
Its not possible now. Yesterday I gave up with code::blocks and fired up gdb (with the binary built up by code::blocks) And all the variables were visible fine.
And today I needed to debug another piece of code and having code::blocks still open I forgot about its debugging strangeness so I fired debugger again. This time I can see the variables.
Well, its not that it magically started debugging in code::blocks. I tried to debug exactly the same function I did the first time and I still see <optimized out> for most variables, but the same binary debugs fine in gdb. I give up on this and will use gdb for those functions that do not show variables in code::blocks.