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

Online stahta01

  • Lives here!
  • ****
  • Posts: 6434
    • My Best Post
Re: Unable to read source file
« Reply #30 on: July 28, 2018, 09:48:31 am »
Quote
Why are you building with 3.0 instead of 2.8 that worked for you?
probably to help us xD fix the bug

In that case, they need to have wxWidgets 3.0 installed on the PC.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline LuiZiffer

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Unable to read source file
« Reply #31 on: July 31, 2018, 06:20:23 pm »
Quote
10) The codeblocks window from where you are debugging will pop up, or blink or whatever... It will display the line 149 with a yellow arrow
Sorry, but this doesn't happen. As in, it successfully builds and that's it. What do you mean with faulty file? (I assume you meant the project and clicked on test.cbp)
Also, I completely removed the former codeblocks to install the repo version, I still have the .tar.gz file though.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2250
Re: Unable to read source file
« Reply #32 on: July 31, 2018, 08:26:13 pm »
Quote
(I assume you meant the project and clicked on test.cbp)
and open the c (or cpp) file you have problems with...

Quote
As in, it successfully builds and that's it.
Does the debugee starts?

Offline LuiZiffer

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Unable to read source file
« Reply #33 on: August 01, 2018, 04:51:11 pm »
Quote
Does the debugee starts?
No, it doesn't. The window opened, i selected test.cbp, and it closed, that's it.
I'm using the WLS so I'm using Xming on windows. (Don't know if this is relevant)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2250
Re: Unable to read source file
« Reply #34 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 #35 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: 11481
    • Travis build status
Re: Unable to read source file
« Reply #36 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: 2250
Re: Unable to read source file
« Reply #37 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 #38 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 #39 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: 11481
    • Travis build status
Re: Unable to read source file
« Reply #40 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 #41 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: 2250
Re: Unable to read source file
« Reply #42 on: January 17, 2019, 10:50:24 pm »
no windows 10 to debug :/

Offline Miguel Gimenez

  • Almost regular
  • **
  • Posts: 205
Re: Unable to read source file
« Reply #43 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.