Author Topic: Step into a C function problem  (Read 4202 times)

Offline wcorigan

  • Single posting newcomer
  • *
  • Posts: 3
Step into a C function problem
« on: March 16, 2018, 02:44:54 am »
1. I am experiencing a problem stepping thru 'c' code. The stepping works until when I come to a native 'c' function like printf("hello world");, then step into does not work and I get an error: Cannot open file: oiputs.c
Seems like it can't find the C library.

2. After upgrading to 17.12 I get an error on startup. (In an attempt to fix 1.)
List of failed plugins:
libFIlemanager.so
libSpellChecker.so

Any help would be appreciated.

OS:Ubuntu 17.10
AMD Athlon 64-bit
Code::Blocks 17.12 (also 16.01)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Step into a C function problem
« Reply #1 on: March 16, 2018, 08:49:25 am »
1. you need the source code of glibc for this to work
2. you've not removed all parts from the old install and have not replaced them with new ones. Most probably you need to install the codeblocks-contrib package.
(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 wcorigan

  • Single posting newcomer
  • *
  • Posts: 3
Re: Step into a C function problem
« Reply #2 on: March 16, 2018, 03:47:39 pm »
In an attempt to resolve the step issue; I installed Code::Blocks on my Windows 10 system. The Windows 10 system doesn't have the problem. (note: This is a pet peeve of mine, developers developing in a Widows environment and not testing Linux functionality) This is particularly frustrating when using C, might expect this in Visual Basic or something.

I believe the glibc source code would solve the, where to put it and how to link it to the debugger?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Step into a C function problem
« Reply #3 on: March 16, 2018, 07:59:49 pm »
You have to put it where the debugger expects to be.
But do you really need to step in the internals of glibc functions?
I doubt you want to do this.
(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 wcorigan

  • Single posting newcomer
  • *
  • Posts: 3
Re: Step into a C function problem
« Reply #4 on: March 17, 2018, 04:41:35 pm »
I really don't want to step thru the C functions. My goal is to step thru my code, watch variables, etc. I can't do it with Ubuntu OS, because Code::Blocks won't execute the any "C" function. For example when trying to step into a printf(); statement one gets the error:
error: Cannot open file: oiputs.c

Update: I switched to Windows and the step into functions work. I just went back to Ubuntu to bring up another example and it works. Didn't touch a thing and all the steps into functions now work in Ubuntu. There is some commonality in the code location. I give up! It works (for now). Thanks for your help.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Step into a C function problem
« Reply #5 on: March 17, 2018, 05:47:15 pm »
Just to make the wording clear
Code
-> printf("blabla")
if the cursor is on this position and you use "step in" the debugger jumps INTO printf and codeblocks tries to open the corresponding c file. In this case you have to use "next line" near the "step into" button. If you hit the wrong button and can not go future, simply press "step out" and the cursor will come back...