This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch v8 05/24] frame: artificial frame id's
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- Cc: Pedro Alves <palves at redhat dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Fri, 13 Dec 2013 12:27:10 +0100
- Subject: Re: [patch v8 05/24] frame: artificial frame id's
- Authentication-results: sourceware.org; auth=none
- References: <1386839747-8860-1-git-send-email-markus dot t dot metzger at intel dot com> <1386839747-8860-6-git-send-email-markus dot t dot metzger at intel dot com> <52AA10DD dot 2020506 at redhat dot com> <20131212195531 dot GA6092 at host2 dot jankratochvil dot net> <A78C989F6D9628469189715575E55B230AA37498 at IRSMSX104 dot ger dot corp dot intel dot com>
On Fri, 13 Dec 2013 09:04:11 +0100, Metzger, Markus T wrote:
> Would it be OK to have no frame be equal to null_frame_id?
>
> diff --git a/gdb/frame.c b/gdb/frame.c
> index 37d780e..efda1cc 100644
> --- a/gdb/frame.c
> +++ b/gdb/frame.c
> @@ -577,16 +577,17 @@ frame_id_eq (struct frame_id l, struct frame_id r)
> {
> int eq;
>
> - if (memcmp (&l, &r, sizeof (l)) == 0)
> - /* Every frame is equal to itself.
> + if (memcmp (&l, &null_frame_id, sizeof (l)) == 0
> + || memcmp (&r, &null_frame_id, sizeof (r)) == 0)
> + /* Like a NaN, if either ID is invalid, the result is false.
> + Note that a frame ID is invalid iff it is the null frame ID. */
> + eq = 0;
> + else if (memcmp (&l, &r, sizeof (l)) == 0)
> + /* Every valid frame is equal to itself.
> This is the dodgy thing about outer_frame_id, since between execution
> steps we might step into another function - from which we can't unwind
> either. More thought required to get rid of outer_frame_id. */
> eq = 1;
> - else if (!l.stack_addr_p || !r.stack_addr_p)
> - /* Like a NaN, if either ID is invalid, the result is false.
> - Note that a frame ID is invalid iff it is the null frame ID. */
> - eq = 0;
> else if (l.stack_addr != r.stack_addr)
> /* If .stack addresses are different, the frames are different. */
> eq = 0;
It looks OK to me. I have filed:
py-finishbreakpoint.c incorrect frame_id_eq
https://sourceware.org/bugzilla/show_bug.cgi?id=16324
I have found in create_sentinel_frame:
/* Make the sentinel frame's ID valid, but invalid. That way all
comparisons with it should fail. */
frame->this_id.p = 1;
frame->this_id.value = null_frame_id;
Although I haven't found any code (besides the python above) to depend on it.
Jan