Author Topic: can I "step into" code in a static library  (Read 4475 times)

Offline bootstrap

  • Multiple posting newcomer
  • *
  • Posts: 64
can I "step into" code in a static library
« on: July 16, 2012, 12:01:45 am »
I'm trying to debug a small function in a static library linked to my code.  I do not have control of the static library source code, but the function I am calling (that appears to have a minor bug, or more specifically, an "imprecision"), is simple enough that I could figure out the problem if I step through the ~50-ish assembly/machine language instructions it takes to execute.

However, "step-into" doesn't seem to step into those functions.  I just had a multi-message conversation in the linuxquestions website, where I am assured gdb can step into static-linked functions (and maybe even shared library functions, though I don't see how that can be true if other running applications are linked to the same shared library --- unless gdb somehow copies the entire contents of that library into a newly allocated chunk of memory at exactly the same local addresses).

Which leads me to realize it matters exactly what codeblocks does to "step-into".  How should this work, and is there a way I can make codeblocks "step-into" code in a static library?

I am only concerned about doing this in 64-bit ubuntu linux 12.04 --- at this point, anyway.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: can I "step into" code in a static library
« Reply #1 on: July 16, 2012, 12:41:16 am »
Instead of "step into" you should try "step into instruction" (the button just before the "pause" button in the debuggers toolbar).

Why shouldn't it be possible to step into static or shared libs ?
Shared means that it is not part of your executable (or others), but at runtime the programs use their own memory context of course.
Without that no system would be able to run.