From: Joel Brobecker <brobecker@gnat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA/controversial] move bp by line number past the prologue
Date: Thu, 29 Aug 2002 11:37:00 -0000 [thread overview]
Message-ID: <20020829181524.GC971@gnat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1145 bytes --]
This proposal has been discussed on this gdb-patches mailing list, and
there has been no consensus. Some of us are in favor of this change,
others are against. I am submitting this change for approval as a
request to make a decision. I don't know if making a small summary of
the different points for/against this change of behavior would be
useful, all the discussion is archived under
[RFC] breakpoints and function prologues...
http://sources.redhat.com/ml/gdb-patches/2002-07/msg00448.html and
http://sources.redhat.com/ml/gdb-patches/2002-07/msg00451.html
Let me know if you would like to see such a summary (I'll try not to
distort too much the different points too much in my favor :-).
2002-08-29 Jim Ingham <jingham@apple.com>
* linespec.c (decode_line_1): Skip the function prologue if
funfirstline is set. Changes the behavior of the break command
to skip the function prologue when breaking by line number.
This change introduces 5 FAILs in one testcase which assumes the current
behavior, so the FAIL is expected. Should this patch be approved, I'll
the testcase up.
Ahem... Ok to apply?
--
Joel
[-- Attachment #2: linespec.c.diff --]
[-- Type: text/plain, Size: 1312 bytes --]
Index: linespec.c
===================================================================
RCS file: /cvs/src/src/gdb/linespec.c,v
retrieving revision 1.21
diff -c -3 -p -r1.21 linespec.c
*** linespec.c 11 May 2002 22:46:19 -0000 1.21
--- linespec.c 29 Aug 2002 18:03:02 -0000
*************** decode_line_1 (char **argptr, int funfir
*** 1067,1073 ****
--- 1067,1097 ----
if (val.symtab == 0)
val.symtab = s;
+ /* If funfirstline is set, we need to look up the function
+ containing the line, and move past the prologue. */
+
val.pc = 0;
+ if (funfirstline)
+ {
+ CORE_ADDR pc = 0;
+
+ if (find_line_pc (val.symtab, val.line, &pc))
+ {
+ struct symbol *func_sym;
+ struct symtab_and_line sal;
+
+ func_sym = find_pc_function (pc);
+ if (func_sym)
+ {
+ sal = find_function_start_sal (func_sym, 1);
+ /* Don't move the line, just set the pc
+ to the right place. */
+ if (val.line <= sal.line)
+ val.pc = sal.pc;
+ }
+ }
+ }
+
values.sals = (struct symtab_and_line *)
xmalloc (sizeof (struct symtab_and_line));
values.sals[0] = val;
next reply other threads:[~2002-08-29 18:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-29 11:37 Joel Brobecker [this message]
2002-08-29 13:20 ` Kevin Buettner
2002-08-29 13:37 ` Andrew Cagney
2002-08-29 14:50 ` Kevin Buettner
2002-08-29 15:30 ` Michael Snyder
2002-08-30 12:06 ` Joel Brobecker
2002-08-30 17:55 ` 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=20020829181524.GC971@gnat.com \
--to=brobecker@gnat.com \
--cc=gdb-patches@sources.redhat.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