Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@codesourcery.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Mark Kettenis <mark.kettenis@xs4all.nl>,
	 uweigand@de.ibm.com, 	  brobecker@adacore.com,
	 msnyder@specifix.com, 	  gdb-patches@sourceware.org
Subject: Re: [RFC/RFA?] Should break FILE:LINENO skip prologue?
Date: Wed, 16 Jan 2008 21:36:00 -0000	[thread overview]
Message-ID: <m3ir1t78s4.fsf@codesourcery.com> (raw)
In-Reply-To: <ulk6pppje.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 16 Jan 2008 20:56:53 +0200")


Eli Zaretskii <eliz at gnu.org> writes:
>> Date: Wed, 16 Jan 2008 11:34:41 +0100 (CET)
>> From: Mark Kettenis <mark.kettenis@xs4all.nl>
>> CC: uweigand@de.ibm.com, brobecker@adacore.com, msnyder@specifix.com,
>>         gdb-patches@sourceware.org
>> 
>> > Btw, the manual does not say *EXPRESSION, it says *ADDRESS.
>> 
>> That's fine as long as the manual says that ADDRESS is parsed as an
>> expression in the current language.
>
> It doesn't.  It says it "may be any expression", which is vague, even
> inaccurate.
>
>> > Anyway, if "break *FILENAME:FUNCTION" does not need to work, then how
>> > does one set a breakpoint on the entry point of FILENAME:FUNCTION,
>> > after the suggested change that makes "break FUNCTION" behave
>> > differently than "break *FUNCTION"?
>> 
>> Joel's change does not change how "break FUNCTION" works at all.  It
>> changes what "break LINE" does in the case where LINE doesn't
>> correspond to an actual line of source code, and makes it more similar
>> to what "break FUNCTION" does, which is putting the breakpoint on the
>> first line of actual code in a function.
>
> My question was about putting the breakpoint on the beginning of the
> prolog of a function in another file, not about "break FUNCTION" or
> "break LINE".  You didn't answer my question: how does one put a
> breakpoint on that address.  For a function in the current file, or
> one whose name identifies it unambiguously, "break *FUNCTION" is the
> solution.  But what about the case where FUNCTION alone is not enough
> to unambiguously specify a function?

GDB allows 'FILENAME'::FUNCTION in C expressions:

  $ cat u.mk
  CC = gcc
  CFLAGS = -g3
  u: u1.o u2.o
          $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
  clean:
          rm -f u u1.o u2.o
  $ cat u1.c
  #include <stdio.h>

  void e (void);

  static void
  s (void)
  {
    puts ("u1.c: s");
  }

  int
  main (int argc, char **argv)
  {
    s ();
    e ();

    return 0;
  }
  $ cat u2.c
  #include <stdio.h>

  static void
  s (void)
  {
    puts ("u2.c: s");
  }

  void
  e (void)
  {
    puts ("u2.c: e");
    s ();
  }
  $ make -f u.mk
  gcc -g3   -c -o u1.o u1.c
  gcc -g3   -c -o u2.o u2.c
  gcc  u1.o u2.o  -o u
  $ ~/gdb/pub/nat/gdb/gdb u
  GNU gdb 6.7.50.20080111-cvs
  Copyright (C) 2008 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "i686-pc-linux-gnu"...
  (gdb) print 'u1.c'::s
  $1 = {void (void)} 0x8048384 <s>
  (gdb) print 'u2.c'::s
  $2 = {void (void)} 0x80483c4 <s>
  (gdb) break *'u1.c'::s
  Breakpoint 1 at 0x8048384: file u1.c, line 7.
  (gdb) break *'u2.c'::s
  Breakpoint 2 at 0x80483c4: file u2.c, line 5.
  (gdb) 


  reply	other threads:[~2008-01-16 21:36 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-09 15:18 Joel Brobecker
2008-01-09 19:11 ` Jim Blandy
2008-01-09 19:16   ` Daniel Jacobowitz
2008-01-09 19:46     ` Joel Brobecker
2008-01-09 20:38       ` Eric Botcazou
2008-01-10 11:01         ` Mark Kettenis
2008-01-10 11:45           ` Eric Botcazou
2008-01-10 21:47             ` Michael Snyder
2008-01-10 22:10               ` Mark Kettenis
2008-01-11  5:36                 ` Joel Brobecker
2008-01-11 11:28                   ` Mark Kettenis
2008-01-11 18:22                     ` Joel Brobecker
2008-01-11 21:07                       ` Eli Zaretskii
2008-01-11 21:14                         ` Mark Kettenis
2008-01-12 12:18                           ` Eli Zaretskii
2008-01-12 14:30                             ` Joel Brobecker
2008-01-12 12:25                           ` Eli Zaretskii
2008-01-12 14:35                             ` Joel Brobecker
2008-01-12 15:32                             ` Mark Kettenis
2008-01-12 15:55                               ` Eli Zaretskii
2008-01-12 16:03                                 ` Joel Brobecker
2008-01-12 16:26                                   ` Eli Zaretskii
2008-01-12 16:18                                 ` Mark Kettenis
2008-01-12 16:57                                   ` Eli Zaretskii
2008-01-12 17:58                                     ` Daniel Jacobowitz
2008-01-13  4:22                                       ` Eli Zaretskii
2008-01-13  6:25                                         ` Joel Brobecker
2008-01-13  6:54                                           ` Eli Zaretskii
2008-01-13 10:36                                             ` Joel Brobecker
2008-01-14 23:02                                               ` Michael Snyder
2008-01-15  3:57                                                 ` Joel Brobecker
2008-01-14 22:57                                             ` Michael Snyder
2008-01-13  9:21                                         ` Mark Kettenis
2008-01-13 10:19                                           ` Eli Zaretskii
2008-01-14 22:25                                             ` Jim Blandy
2008-01-14 22:33                                               ` Mark Kettenis
2008-01-14 10:30                                           ` Pierre Muller
2008-01-14 12:25                                             ` Daniel Jacobowitz
2008-01-14 23:00                                           ` Michael Snyder
2008-01-15 17:13                                             ` Jim Blandy
2008-01-14 22:17                                         ` Jim Blandy
2008-01-14 22:50                               ` Michael Snyder
2008-01-15 12:29                                 ` Daniel Jacobowitz
2008-01-15 12:39                                   ` Joel Brobecker
2008-01-15 17:15                                     ` Jim Blandy
2008-01-15 18:47                                     ` Eli Zaretskii
2008-01-15 21:40                                       ` Ulrich Weigand
2008-01-15 23:24                                         ` Andreas Schwab
2008-01-16  4:21                                           ` Eli Zaretskii
2008-01-16  9:13                                             ` Andreas Schwab
2008-01-16 18:49                                               ` Eli Zaretskii
2008-01-16 21:13                                                 ` Andreas Schwab
2008-01-16  4:15                                         ` Eli Zaretskii
2008-01-16  4:20                                         ` Eli Zaretskii
2008-01-16 10:35                                           ` Mark Kettenis
2008-01-16 18:57                                             ` Eli Zaretskii
2008-01-16 21:36                                               ` Jim Blandy [this message]
2008-01-17  4:13                                                 ` Eli Zaretskii
2008-01-17  4:18                                                   ` Michael Snyder
2008-01-17  9:47                                                     ` Mark Kettenis
2008-01-17 21:51                                                       ` Michael Snyder
2008-01-17 22:09                                                         ` Jim Blandy
2008-01-17 23:42                                                           ` Michael Snyder
2008-01-17 18:38                                                   ` Jim Blandy
2008-01-19 13:47                                                     ` Eli Zaretskii
2008-01-20 15:03                                                       ` Joel Brobecker
2008-01-20 19:50                                                         ` Eli Zaretskii
2008-01-21  2:27                                                           ` Joel Brobecker
2008-01-26 19:58                                                             ` Eli Zaretskii
2008-01-16 21:25                                         ` Jim Blandy
2008-01-16  2:10                                   ` Michael Snyder
2008-01-11 20:32                   ` Michael Snyder
2008-01-11 20:36                     ` Eric Botcazou
2008-01-10 22:21               ` Eric Botcazou
2008-01-10 14:06           ` Daniel Jacobowitz
2008-01-10 17:06             ` Jim Blandy
2008-01-09 19:44   ` Joel Brobecker
2008-01-09 19:16 ` Mark Kettenis
2008-01-09 20:01   ` Joel Brobecker
2008-01-09 20:25 ` Michael Snyder
2008-01-09 20:35   ` Joel Brobecker
2008-01-09 21:05     ` Michael Snyder
2008-01-10  4:16       ` Joel Brobecker
2008-01-10  9:29         ` Andreas Schwab
2008-01-11 10:35           ` Eli Zaretskii
2008-01-10 10:39         ` Mark Kettenis
2008-01-10 15:39           ` Joel Brobecker
2008-01-10 15:51           ` Daniel Jacobowitz
2008-01-11 10:44             ` Eli Zaretskii
2008-01-10  4:16       ` Eli Zaretskii
2008-01-10 15:46       ` Daniel Jacobowitz
2008-01-10 21:49         ` Michael Snyder
2008-01-10 17:15   ` Jim Blandy
2008-01-31 22:17 ` Daniel Jacobowitz
2008-01-31 22:59   ` Joel Brobecker
2008-02-02  1:20   ` Joel Brobecker
2008-02-27 19:48     ` Daniel Jacobowitz
2008-02-27 20:52       ` Joel Brobecker

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=m3ir1t78s4.fsf@codesourcery.com \
    --to=jimb@codesourcery.com \
    --cc=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    --cc=msnyder@specifix.com \
    --cc=uweigand@de.ibm.com \
    /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: link
Be 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