RE: [patch v8 05/24] frame: artificial frame id's

Metzger, Markus T
2013-12-13T08:04:19Z

> -----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