From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <pedro@palves.net>,
Andrew Burgess <andrew.burgess@embecosm.com>,
gdb-patches@sourceware.org
Subject: Re: [PATCHv2 1/2] gdb: prevent an assertion when computing the frame_id for an inline frame
Date: Mon, 5 Jul 2021 10:14:39 -0400 [thread overview]
Message-ID: <598dbed0-85c7-64e8-54d6-2f50bb2591f2@polymtl.ca> (raw)
In-Reply-To: <9c6022ea-4f2b-bae9-6c41-8b0c87952c5a@palves.net>
On 2021-07-05 7:39 a.m., Pedro Alves wrote:
> Hi Andrew,
>
> I've read this, and I think you came up with a reasonable solution.
I discussed this with Andrew on IRC, and my bad, I didn't post the
summary of our discussions here.
I suggested that this was confusing because get_prev_frame_if_no_cycle
now becomes get_prev_frame_if_no_cycle_except_in_some_cases, and it
makes get_prev_frame_if_no_cycle alter its behavior based on what it
thinks its caller is doing. And it causes the inline frame's this_id
method to "lie" if it can't successfully compute the frame id, instead
of properly reporting failure. The problem, in my opinion, is that:
- inline_frame_this_id is currently not allowed to fail (return
null_frame_id)
- inline_frame_this_id uses get_prev_frame_if_no_cycle, which is
allowed to fail (return nullptr)
So the question, in my opinion, is: how to propagate the
get_prev_frame_if_no_cycle failure up the stack. I suggested that the
this_id method could throw a "FRAME_CYCLE_ERROR" in that case, caught
by the get_prev_frame_if_no_cycle call up the stack. It would then
set the last physical frame's stop reason to UNWIND_SAME_ID.
I made a prototype here, which passes Andrew's test:
https://review.lttng.org/c/binutils-gdb/+/6122
I prefer this option because it avoids adding special cases. If the id
can't be computed, this_id throws and that's it, the caller decides what
to do with it. But if people prefer the original solution, I don't
mind :).
Simon
next prev parent reply other threads:[~2021-07-05 14:14 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-29 20:57 [PATCH 0/5] Fix for an assertion when unwinding with inline frames Andrew Burgess
2021-05-29 20:57 ` [PATCH 1/5] gdb/python: handle saving user registers in a frame unwinder Andrew Burgess
2021-06-07 14:50 ` Tom Tromey
2021-06-07 16:10 ` Andrew Burgess
2021-06-07 20:38 ` Tom Tromey
2021-06-07 17:07 ` Lancelot SIX
2021-06-07 17:20 ` Simon Marchi
2021-06-07 18:01 ` Lancelot SIX
2021-06-07 18:09 ` Simon Marchi
2021-06-07 20:12 ` Andrew Burgess
2021-06-21 19:41 ` Andrew Burgess
2021-05-29 20:57 ` [PATCH 2/5] gdb/python: move PyLong_From* calls into py-utils.c Andrew Burgess
2021-06-07 14:53 ` Tom Tromey
2021-06-21 19:42 ` Andrew Burgess
2021-05-29 20:57 ` [PATCH 3/5] gdb/python: add PendingFrame.level and Frame.level methods Andrew Burgess
2021-05-30 5:55 ` Eli Zaretskii
2021-05-30 18:34 ` Andrew Burgess
2021-05-30 18:54 ` Eli Zaretskii
2021-06-07 14:57 ` Tom Tromey
2021-06-21 19:42 ` Andrew Burgess
2021-05-29 20:57 ` [PATCH 4/5] gdb: prevent an assertion when computing the frame_id for an inline frame Andrew Burgess
2021-05-29 20:57 ` [PATCH 5/5] gdb: remove VALUE_FRAME_ID Andrew Burgess
2021-06-21 19:46 ` [PATCHv2 0/2] Fix for an assertion when unwinding with inline frames Andrew Burgess
2021-06-21 19:46 ` [PATCHv2 1/2] gdb: prevent an assertion when computing the frame_id for an inline frame Andrew Burgess
2021-07-05 11:39 ` Pedro Alves
2021-07-05 14:14 ` Simon Marchi [this message]
2021-06-21 19:46 ` [PATCHv2 2/2] gdb: remove VALUE_FRAME_ID Andrew Burgess
2021-06-29 17:53 ` Simon Marchi
2021-06-30 15:18 ` Andrew Burgess
2021-07-05 14:22 ` Simon Marchi
2021-07-20 9:10 ` [PATCHv3 0/2] Fix for an assertion when unwinding with inline frames Andrew Burgess
2021-07-20 9:10 ` [PATCHv3 1/2] gdb: prevent an assertion when computing the frame_id for an inline frame Andrew Burgess
2021-07-20 9:10 ` [PATCHv3 2/2] gdb: remove VALUE_FRAME_ID Andrew Burgess
2021-07-20 21:59 ` [PATCHv3 0/2] Fix for an assertion when unwinding with inline frames Simon Marchi
2021-07-26 11:11 ` Andrew Burgess
2021-07-26 13:57 ` Simon Marchi
2021-07-27 10:06 ` Andrew Burgess
2021-07-27 10:10 ` [PATCHv4] gdb: prevent an assertion when computing the frame_id for an inline frame Andrew Burgess
2021-08-09 15:41 ` [PATCHv5] " Andrew Burgess
2021-08-23 9:41 ` Andrew Burgess
2021-08-23 10:26 ` Pedro Alves
2021-08-23 12:31 ` Andrew Burgess
2021-09-20 10:04 ` Andrew Burgess
2021-09-20 12:24 ` Pedro Alves
2021-09-21 13:52 ` Andrew Burgess
2021-09-21 13:54 ` [PATCHv6] " Andrew Burgess
2021-09-22 14:14 ` Simon Marchi
2021-09-22 16:46 ` Andrew Burgess
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=598dbed0-85c7-64e8-54d6-2f50bb2591f2@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@palves.net \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).