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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6363
    • 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: 2092
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: 2092
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: 11263
    • 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: 2092
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 »