Re: gdb Digest, Vol 60, Issue 2
jhh <[email protected]> Wed, 28 Jan 2009 17:18:55 -0500
| Newsgroups | gmane.comp.gdb.general |
|---|---|
| Organization | ADC |
| Message-ID | <[email protected]> |
[email protected] wrote: > Message: 1 > Date: Tue, 27 Jan 2009 21:15:43 -0800 (PST) > From: UltrosMaximus <[email protected]> > Subject: Break point on shared library function not working...? > To: [email protected] > Message-ID: <[email protected]> > Content-Type: text/plain; charset=us-ascii > > > Hey, so I'm just writing a small little c program here and trying to get the > break points working but I can't seem to get it to break on a shared > library. > > here's my program: > > #include <stdio.h> > #include <string.h> > > int main() { > char str_a[20]' > > strcpy(str_a, "hello"); > printf(str_a); > } > > (snip) Don't think breaking on such a call should work, anyway. How would gdb know which (of possibly many strcpy calls) to break on. All? Then what - gdb stepping through it would be useless (no debug info). Just break on char_array2.c:6 . Want to trace all calls to strcpy? Add your own and break on its first line (compiler will howl but do what you said). And by the way, if you do, with "break strcpy", my gdb will in fact break on the FIRST call only !