From: Daniel Jacobowitz <drow@false.org>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [FYI] Inlining support, rough patch
Date: Wed, 02 Jul 2008 19:15:00 -0000 [thread overview]
Message-ID: <20080702191438.GA3735@caradoc.them.org> (raw)
In-Reply-To: <20080623115422.GA17511@host0.dyn.jankratochvil.net>
[-- Attachment #1: Type: text/plain, Size: 834 bytes --]
On Mon, Jun 23, 2008 at 01:54:22PM +0200, Jan Kratochvil wrote:
> Hi,
>
> here are some fixes on top of it. I find now your patch useful on top of CVS
> HEAD. I expect some of its problems were probably due to the patch separation
> from the CodeSourcery patchset.
>
> On x86+x86_64+ppc64 with gcc-4.3.1-2 (Fedora) there are no regressions.
> On x86+x86_64 with gcc-4.3.1-2 (Fedora) the provided tests PASS.
> (On ppc64 the tests FAIL as multi-PC breakpoints do not work there.)
Thanks for the patches. Here's a copy of your diff minus the parts
I've merged (or solved differently). I'm not planning to put in any
of these parts yet, but we can talk about them if you have examples
where they help.
Let's wait on that until the rest of the patch is ready, though.
I'm making good progress.
--
Daniel Jacobowitz
CodeSourcery
[-- Attachment #2: gdb-inline-works3.patch.left --]
[-- Type: text/plain, Size: 6003 bytes --]
diff -up -u -X /home/jkratoch/.diffi.list -rupxCVS sources-codesourceryinline-gdb/breakpoint.c sources/gdb/breakpoint.c
--- sources-codesourceryinline-gdb/breakpoint.c 2008-06-20 15:59:08.000000000 +0200
+++ sources/gdb/breakpoint.c 2008-06-22 23:45:57.000000000 +0200
@@ -3076,6 +3076,11 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
bs->print = 0;
}
bs->commands = copy_command_lines (bs->commands);
+
+ /* We display the innermost inlined frame at a breakpont as it gives to
+ most of the available information. */
+ if (b->type != bp_until && b->type != bp_finish)
+ set_skipped_inline_frames (0);
}
/* Print nothing for this entry if we dont stop or if we dont print. */
diff -up -u -X /home/jkratoch/.diffi.list -rupxCVS sources-codesourceryinline-gdb/frame.c sources/gdb/frame.c
--- sources-codesourceryinline-gdb/frame.c 2008-06-20 15:59:09.000000000 +0200
+++ sources/gdb/frame.c 2008-06-22 18:01:02.000000000 +0200
@@ -422,12 +422,12 @@ frame_id_inner (struct gdbarch *gdbarch,
if (!l.stack_addr_p || !r.stack_addr_p)
/* Like NaN, any operation involving an invalid ID always fails. */
inner = 0;
- else if (l.inline_depth > r.inline_depth
+ else if (l.inline_depth < r.inline_depth
&& l.stack_addr == r.stack_addr
&& l.code_addr_p == r.code_addr_p
- && l.code_addr == r.code_addr
+ && (!l.code_addr_p || l.code_addr == r.code_addr)
&& l.special_addr_p == r.special_addr_p
- && l.special_addr == r.special_addr)
+ && (!l.special_addr_p || l.special_addr == r.special_addr))
{
/* Same function, different inlined functions. */
struct block *lb, *rb;
@@ -1697,7 +1697,7 @@ find_frame_sal (struct frame_info *frame
sym = inline_skipped_symbol ();
init_sal (sal);
- if (SYMBOL_LINE (sym) != 0)
+ if (sym && SYMBOL_LINE (sym) != 0)
{
sal->symtab = SYMBOL_SYMTAB (sym);
sal->line = SYMBOL_LINE (sym);
diff -up -u -X /home/jkratoch/.diffi.list -rupxCVS sources-codesourceryinline-gdb/infcmd.c sources/gdb/infcmd.c
--- sources-codesourceryinline-gdb/infcmd.c 2008-06-20 15:59:09.000000000 +0200
+++ sources/gdb/infcmd.c 2008-06-17 20:57:03.000000000 +0200
@@ -758,7 +758,13 @@ step_1 (int skip_subroutines, int single
if (!target_can_async_p ())
{
for (; count > 0; count--)
- step_once (skip_subroutines, single_inst, count, thread);
+ {
+ step_once (skip_subroutines, single_inst, count, thread);
+
+ /* Unexpected breakpoint terminates our multistepping. */
+ if (!stop_step)
+ break;
+ }
do_cleanups (cleanups);
}
diff -up -u -X /home/jkratoch/.diffi.list -rupxCVS sources-codesourceryinline-gdb/inline-frame.c sources/gdb/inline-frame.c
--- sources-codesourceryinline-gdb/inline-frame.c 2008-06-20 15:59:09.000000000 +0200
+++ sources/gdb/inline-frame.c 2008-06-23 00:54:53.000000000 +0200
@@ -90,7 +130,12 @@ inline_frame_sniffer (const struct frame
frame_block = block_for_pc (this_pc);
if (frame_block == NULL)
return 0;
+ /* INLINE_SKIP_SYMBOL does not need to be set for each specific frame. But
+ * it needs to be recalculated after STEP_INTO_INLINE_FRAME according to new
+ * INLINE_SKIP_FRAMES - therefore SET_SKIPPED_INLINE_FRAMES is too early. */
+ inline_skip_symbol = NULL;
+
/* Calculate DEPTH, the number of inlined functions at this
location. */
depth = 0;
@@ -104,7 +154,9 @@ inline_frame_sniffer (const struct frame
{
if (block_inlined_p (cur_block))
depth++;
+ if (depth == inline_skip_frames && inline_skip_symbol == NULL)
+ inline_skip_symbol = BLOCK_FUNCTION (cur_block);
cur_block = BLOCK_SUPERBLOCK (cur_block);
}
@@ -189,7 +247,6 @@ set_skipped_inline_frames (int skip_ok)
{
CORE_ADDR this_pc;
struct block *frame_block, *cur_block;
- struct symbol *last_sym = NULL;
int skip_count = 0;
if (!skip_ok)
@@ -219,19 +276,23 @@ set_skipped_inline_frames (int skip_ok)
of BLOCK_START. */
if (BLOCK_START (cur_block) == this_pc
|| block_starting_point_at (this_pc, cur_block))
+ skip_count++;
+ else
{
- skip_count++;
- last_sym = BLOCK_FUNCTION (cur_block);
+ /* Here we will stop at any possible inlining after we
+ already crossed any first non-inlined function. We could
+ possibly detect such functions generating NORMAL_FRAME
+ by `!block_inlined_p && BLOCK_FUNCTION' (as
+ `!block_inlined_p && !BLOCK_FUNCTION' are just anonymous
+ local { ... } blocks). */
+ break;
}
- else
- break;
}
cur_block = BLOCK_SUPERBLOCK (cur_block);
}
}
inline_skip_pc = this_pc;
- inline_skip_symbol = last_sym;
if (inline_skip_frames != skip_count)
{
diff -up -u -X /home/jkratoch/.diffi.list -rupxCVS sources-codesourceryinline-gdb/testsuite/gdb.cp/annota2.exp sources/gdb/testsuite/gdb.cp/annota2.exp
--- sources-codesourceryinline-gdb/testsuite/gdb.cp/annota2.exp 2008-06-20 15:58:04.000000000 +0200
+++ sources/gdb/testsuite/gdb.cp/annota2.exp 2008-06-18 18:44:11.000000000 +0200
@@ -119,13 +119,14 @@ gdb_expect {
# continue until exit
# this will test:
# annotate-exited
+# `a.x is 1' is asynchronous regarding to `frames-invalid'.
#
send_gdb "continue\n"
gdb_expect {
- -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\na.x is 1\r\n\r\n\032\032exited 0\r\n\r\nProgram exited normally.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
+ -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\r\n(\r\n\032\032frames-invalid\r\n)*a.x is 1\r\n(\r\n\032\032frames-invalid\r\n)*\r\n\032\032exited 0\r\n\r\nProgram exited normally.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
{ pass "continue until exit" }
- -re ".*$gdb_prompt$" { fail "continue to exit" }
- timeout { fail "continue to exit (timeout)" }
+ -re ".*$gdb_prompt$" { fail "continue until exit" }
+ timeout { fail "continue until exit (timeout)" }
}
#
next prev parent reply other threads:[~2008-07-02 19:15 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-13 19:39 Daniel Jacobowitz
2008-06-13 19:43 ` Daniel Jacobowitz
2008-06-23 12:03 ` Jan Kratochvil
2008-06-23 14:23 ` Daniel Jacobowitz
2008-07-02 19:15 ` Daniel Jacobowitz [this message]
2008-07-03 11:22 ` [FYI] Inlining support, rough patch [break-by-function-name] Jan Kratochvil
2008-07-03 16:01 ` Daniel Jacobowitz
2008-07-12 7:41 ` Jan Kratochvil
2008-07-08 0:12 ` [FYI] Inlining support, rough patch Daniel Jacobowitz
2008-07-15 19:21 ` Daniel Jacobowitz
2008-07-17 23:53 ` Mark Kettenis
2008-07-18 13:03 ` Daniel Jacobowitz
[not found] ` <200807251446.m6PEkfwc027635@brahms.sibelius.xs4all.nl>
2008-07-25 17:47 ` Daniel Jacobowitz
2009-03-31 3:06 ` Tom Tromey
2009-03-31 20:49 ` Mark Kettenis
2009-03-31 22:13 ` Daniel Jacobowitz
2009-04-20 15:49 ` Daniel Jacobowitz
2009-04-20 15:54 ` Jan Kratochvil
2009-06-27 18:01 ` Daniel Jacobowitz
2009-06-28 10:16 ` Jan Kratochvil
2009-06-28 13:35 ` Daniel Jacobowitz
2009-06-30 16:11 ` Tom Tromey
2009-06-30 16:50 ` Jan Kratochvil
2009-04-22 22:04 ` Mark Kettenis
2009-04-23 3:17 ` Eli Zaretskii
2009-04-23 5:56 ` Stan Shebs
2009-04-23 12:48 ` Daniel Jacobowitz
2009-06-18 17:55 ` Tom Tromey
2009-06-20 9:57 ` Mark Kettenis
2009-06-20 19:28 ` Samuel Bronson
2009-04-24 21:44 ` Thiago Jung Bauermann
2008-07-18 2:02 ` Paul Pluzhnikov
2008-07-18 3:07 ` Daniel Jacobowitz
2008-07-20 14:41 ` Eli Zaretskii
2008-07-25 13:54 ` Eli Zaretskii
2008-07-25 14:26 ` Daniel Jacobowitz
2008-07-25 16:11 ` Daniel Jacobowitz
2008-07-26 5:58 ` Eli Zaretskii
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=20080702191438.GA3735@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@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