News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Step into a C function problem

Started by wcorigan, March 16, 2018, 02:44:54 AM

Previous topic - Next topic

wcorigan

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)

oBFusCATed

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!]

wcorigan

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?

oBFusCATed

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!]

wcorigan

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.

BlueHazzard

Just to make the wording clear

-> 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...