On Dec 23, 2008, at 6:41 AM, Ryan Graham wrote:
> On Mon, Dec 22, 2008 at 10:09 PM, Chris Miller
> <[email protected]> wrote:
>>
>> On Mon, Dec 22, 2008 at 5:08 PM, Iron_Man  
>> <[email protected]> wrote:
>>>
>>> From the command line I have been using gdb to debug some basic C  
>>> and C
>>> ++ programs to get familiar with using the debugger.  The issue I am
>>> having is that I sometimes get an error about not having the
>>> 'debuginfo' for the libraries.
>>>
>>> For example if I type:
>>>  (gdb) break strcpy
>>>  (gdb) run
>>>
>>> When the debugger gets to the breakpoint for strcpy, I get an error
>>> that I need the debuginfo for the library.  Any help on how I can  
>>> get
>>> the needed debug info, or the correct packages would be much
>>> appreciated.
>>
>> You already know about the -dev editions of the various packages in
>> Linux?  Well, there's also a -dbg edition which includes debug-builds
>> of libraries that can be loaded for debugging purposes.
>>
>
> And in the case of strcpy(), strlcpy(), memcpy(), memset(), and
> similar functions, they probably don't exist as functions in the
> compiled code. These small standard functions tend to be built into
> the compiler and injected in-line when a program is compiled. This
> allows them to be written in optimized assembly without having to be
> called as functions, which could negate the optimizations.
>
> If you are getting a segfault in strcpy(), you are passing it bad
> data, so pick a breakpoint in your code just before you call it.


Most of stdlib is implemented in the kernel itself.

Registered Linux Addict #431495
http://profile.xfire.com/mrstalinman | John 3:16!
http://www.fsdev.net/ | http://lordsauron.wordpress.com/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at 
http://groups.google.com/group/linuxusersgroup
-~----------~----~----~----~------~----~------~--~---

Reply via email to