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: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>, Pedro Alves <palves at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Fri, 13 Dec 2013 08:04:11 +0000
- 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>
> -----Original Message-----
> From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com]
> Sent: Thursday, December 12, 2013 8:56 PM
Thanks for your feedback, Pedro.
Jan already answered some of your questions.
[...]
> > Looks like frame_ id_eq (null_frame_id, null_frame_id) now
> > returns true, while it returns false before. If you discussed
> > all this and came to the conclusion it's OK, please document
> > it in the commit log. In any case (I'm not sure offhand if
> > that's OK), the NaN comment above is no longer correct,
> > and neither is this one:
>
> That was not needed / intentional so it would be better to keep the original
> behavior.
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;
Regards,
Markus.
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052