Author Topic: Unable to read source file  (Read 5590 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2326
Re: Unable to read source file
« Reply #30 on: August 01, 2018, 05:21:53 pm »
what does the debugger log tell you? Pleas enable full debugger logging and post it here (Settings->Debigger->select default, ot gdb on the right side->Full logging

Offline LuiZiffer

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Unable to read source file
« Reply #31 on: August 01, 2018, 06:33:57 pm »
Quote
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
src
Adding source dir: /home/luiziffer/trunk/src/
Adding source dir: /home/luiziffer/trunk/src/
Adding file: /home/luiziffer/trunk/src/devel30/codeblocks
Changing directory to: /home/luiziffer/trunk/src/devel30
Set variable: LD_LIBRARY_PATH=.:/home/luiziffer/trunk/src/base/tinyxml:/home/luiziffer/trunk/src/devel30:/usr/lib64:

[debug]Command-line: /usr/bin/gcc -nx -fullname -quiet  -args /home/luiziffer/trunk/src/devel30/codeblocks
[debug]Working dir : /home/luiziffer/trunk/src/devel30

Starting debugger: /usr/bin/gcc -nx -fullname -quiet  -args /home/luiziffer/trunk/src/devel30/codeblocks
Setting SHELL to '/bin/sh'
done

[debug]gcc: error: unrecognized command line option -quiet
[debug]gcc: error: unrecognized command line option -nx
[debug]gcc: error: unrecognized command line option -fullname
[debug]gcc: error: unrecognized command line option -args

Debugger finished with status 1

I found the setting Full (Debug) Log in Common

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11715
    • Travis build status
Re: Unable to read source file
« Reply #32 on: August 01, 2018, 07:20:35 pm »
Your debugger settings are wrong.
You've set gcc as debugger instead of the correct gdb.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2326
Re: Unable to read source file
« Reply #33 on: August 02, 2018, 09:21:51 am »
Quote
Your debugger settings are wrong.
You've set gcc as debugger instead of the correct gdb.
You can fix this in Settings->Debugger->Default on the left side->Executable path-> point it to gdb

Offline tianrenli92

  • Single posting newcomer
  • *
  • Posts: 1
Re: Unable to read source file
« Reply #34 on: October 27, 2018, 04:30:07 am »
I figured out the reason.
I created two files. test has 616 bytes, which cannot be opened in c::b in Ubuntu (Windows subsystem), with the error described in the original post, and test2 has 617 bytes, which can be opened:
https://imgur.com/a/3eZv6kG
Notice the size on disk, test is 0 byte, while test2 is 4KB.
This happens if the file is so small that its contents and the filesystem bookkeeping fit in 1KB. To save disk space, NTFS keeps small files "resident", storing their contents right in the file record, so no cluster has to be allocated for it.
reference: https://superuser.com/questions/1030800/how-can-a-files-size-on-disk-be-0-bytes-when-theres-data-in-it

TL;DR: If the file is too small (<617B), it may not be found by c::b.

Anyone know how to report the bug?
« Last Edit: October 27, 2018, 04:36:51 am by tianrenli92 »

Offline ked

  • Single posting newcomer
  • *
  • Posts: 2
Re: Unable to read source file
« Reply #35 on: January 17, 2019, 07:37:52 am »
Hi there!
I encountered exactly the same problem with both installations of c::b 16.01 and 17.12, regardless of wx2.x/wx3.x on a Win 10 subsystem for Linux Ubuntu installation (Bionic ver). It seemed completely random which files c::b displayed or not. All files I've tested are completely equal in terms of encoding, permissions, etc. and fully visible in other editors (vi, emacs, gedit, etc) so the discovery of the file size < 617B issue by tianrenli92 really saved my day, and probably the coming week!!! Thank you!!!
The quick fix is of course just to add a few # signs in the files smaller than 617B, but a bug-fix is probably appreciated  ;)

What is the latest news about this issue? Could not find anything about it elsewhere...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11715
    • Travis build status
Re: Unable to read source file
« Reply #36 on: January 17, 2019, 08:38:31 am »
What is the latest news about this issue? Could not find anything about it elsewhere...
Same as before. Someone has to install a debugger, build debug versions of cb and wx and try to see what is going on.

I have enough platforms, so I cannot bother to debug another one. Sorry.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ked

  • Single posting newcomer
  • *
  • Posts: 2
Re: Unable to read source file
« Reply #37 on: January 17, 2019, 11:57:18 am »
Thanx anyway for discovering the file size relation to the problem. I can live with adding #-es to exceed the critical file size, and debugging c::b source code (and similar) is, however, waaaay out of my knowledge.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2326
Re: Unable to read source file
« Reply #38 on: January 17, 2019, 10:50:24 pm »
no windows 10 to debug :/

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 253
Re: Unable to read source file
« Reply #39 on: January 18, 2019, 09:25:53 am »
I have Windows 10 (64 Pro and 32 Home) and don't have such problem with a 71 byte long file.

I think it is related to the Windows Subsystem for Linux file system adaption layer, both posters are using it.