public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Steve Evans <stevee@zuken.co.uk> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: debug/10466: Can't debug the first function in a C file that is included in another C file Date: Fri, 25 Apr 2003 08:56:00 -0000 [thread overview] Message-ID: <20030425085600.16156.qmail@sources.redhat.com> (raw) The following reply was made to PR debug/10466; it has been noted by GNATS. From: Steve Evans <stevee@zuken.co.uk> To: drow@sources.redhat.com, chrisha@zuken.co.uk, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, marcusb@zuken.co.uk, nobody@gcc.gnu.org, stevee@zuken.co.uk, gcc-gnats@gcc.gnu.org Cc: Subject: Re: debug/10466: Can't debug the first function in a C file that is included in another C file Date: 25 Apr 2003 09:53:43 +0100 --=-=-= -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 25 Apr 2003, drow@sources.redhat.com wrote: >Synopsis: Can't debug the first function in a C file that is included >in another C file > >State-Changed-From-To: open->feedback >State-Changed-By: drow >State-Changed-When: Fri Apr 25 02:18:24 2003 >State-Changed-Why: >Please see the bug reporting instructions on gcc.gnu.org. >Could you supply a small testcase? > >http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10466 Ok. Enclosed are two files, foo.c and bar.c. Compile foo.c, which #includes "bar.c" as: gcc -f -fPIC foo.c Note that since reporting the bug I have discovered that it only occurs when compiled with -fPIC. I attempted to add this information to the bug report, but can't edit a report when logged on as guest and there doesn't seem to be any way of creating a new login ID. The run the debugger on it and attempt to break in the function bar, which is the first function in bar.c: ,---- | stevee@gorbag:MY CLONE> gdb ./a.out | GNU gdb 5.3 | Copyright 2002 Free Software Foundation, Inc. | GDB is free software, covered by the GNU General Public License, and you are | welcome to change it and/or distribute copies of it under certain conditions. | Type "show copying" to see the conditions. | There is absolutely no warranty for GDB. Type "show warranty" for details. | This GDB was configured as "sparc-sun-solaris2.6"... | (gdb) b bar | Breakpoint 1 at 0x10aa8 | (gdb) b bar2 | Breakpoint 2 at 0x10aec: file bar.c, line 13. | (gdb) r | Starting program: /tmp/a.out | foo | | Breakpoint 1, 0x00010aa8 in bar () | (gdb) l | 1 #include <stdio.h> | 2 | 3 extern void foo(void); | 4 extern int bar(void); | 5 extern int bar2(void); | 6 | 7 int main() | 8 { | 9 foo(); | 10 bar(); | (gdb) `---- Note that the function bar2 which exists in the same source file can have a break point added successfully. Thanks for any help with this problem. --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=foo.c #include <stdio.h> extern void foo(void); extern int bar(void); extern int bar2(void); int main() { foo(); bar(); bar2(); return 0; } void foo() { printf( "foo\n" ); } #include "bar.c" --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=bar.c int bar() { printf( "bar\n" ); return 0; } int bar2() { printf( "bar2\n" ); return 2; } --=-=-= Steve - -- ____________________________________________________________________________ Steve Evans, Zuken Limited, TEL: +44 (0)1454 207800 ext 8607 1500 Aztec West, Fax: +44 (0)1454 207803 Almondsbury, mailto:stevee@zuken.co.uk Bristol, BS32 4RF, UK Web: http://www.zuken.com Registered Linux user #217906: http://counter.li.org Public Encryption Key: http://www.gorbag.com/public-key-work.html _____________________________________________________________________________ "We are all slaves to our histories. If there is to be a .. bright future, we must learn to break those chains." -- Delenn to Garibaldi in Babylon 5:"GROPOS" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (SunOS) Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/> iD8DBQE+qPeT1a67iNP86GcRAqTuAJ44uyoY1zJr/2/cRSCjZYfjOHi1QQCfWltl Woad71WrkYk2iHuacIa4Twg= =NYKO -----END PGP SIGNATURE----- --=-=-=--
next reply other threads:[~2003-04-25 8:56 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-04-25 8:56 Steve Evans [this message] -- strict thread matches above, loose matches on Subject: below -- 2003-04-25 13:10 drow 2003-04-25 2:18 drow 2003-04-23 16:46 stevee
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20030425085600.16156.qmail@sources.redhat.com \ --to=stevee@zuken.co.uk \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).