public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/28538] New: Consider adding possibility to call gdb unwinder for the heavy lifting
@ 2021-11-03 15:16 plasmahh at gmx dot net
  2022-02-19 16:08 ` [Bug python/28538] " tromey at sourceware dot org
  2022-02-19 20:32 ` plasmahh at gmx dot net
  0 siblings, 2 replies; 3+ messages in thread
From: plasmahh at gmx dot net @ 2021-11-03 15:16 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28538

            Bug ID: 28538
           Summary: Consider adding possibility to call gdb unwinder for
                    the heavy lifting
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: plasmahh at gmx dot net
  Target Milestone: ---

When writing an python unwinder  the current approach is an "all or nothing"
kind. Often one does want to do a little more on top of what gdb would do, but
has to do it all on your own. It would be nice to be able to call the gdb
unwinder to "see what it says" and then to work from that on. Best possibly by
being able to call super().__call__(pending_frame) from within your own
__call__ (similar to frame decorators/filters)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug python/28538] Consider adding possibility to call gdb unwinder for the heavy lifting
  2021-11-03 15:16 [Bug python/28538] New: Consider adding possibility to call gdb unwinder for the heavy lifting plasmahh at gmx dot net
@ 2022-02-19 16:08 ` tromey at sourceware dot org
  2022-02-19 20:32 ` plasmahh at gmx dot net
  1 sibling, 0 replies; 3+ messages in thread
From: tromey at sourceware dot org @ 2022-02-19 16:08 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28538

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Could you expand on this a little to explain when it would be useful?
I couldn't think of a situation where it really made sense to me.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug python/28538] Consider adding possibility to call gdb unwinder for the heavy lifting
  2021-11-03 15:16 [Bug python/28538] New: Consider adding possibility to call gdb unwinder for the heavy lifting plasmahh at gmx dot net
  2022-02-19 16:08 ` [Bug python/28538] " tromey at sourceware dot org
@ 2022-02-19 20:32 ` plasmahh at gmx dot net
  1 sibling, 0 replies; 3+ messages in thread
From: plasmahh at gmx dot net @ 2022-02-19 20:32 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28538

--- Comment #2 from Dennis Lubert <plasmahh at gmx dot net> ---
I might have overlooked some functionality, but as I understand it, in the 
__call__ you either return nothing, which means gdb will do the full next step,
or you have to provide all registers in the unwind info and return that. 

The nature of debugging for me often means that just a little bit is wrong,
often due to memory corruption (and only very rarely due to some problem with
gdb or the debug information getting things wrong)....

This means that what I really want to do is say gdb "no, at that point $sp is x
not y ... or $pc ... or even more rarely $rdi or something...


What I did is write me a little plugin that allows me to override values for
registers. If intrested, there is an example for the use at
https://github.com/PlasmaHH/vdb/blob/master/doc/UNWIND.md#example (which is the
core file I tried to debug once where I needed that thing)

The problem here is that since I could not find another way, what I did was in
a first round return None all the time but save the pending_frame information,
then cause gdb to reset its registers which causes the unwinder to be called
again (which has ugly side effects, which is the main reason I would like
something cleaner) and then return the previously saved pending frame but
replaces the manually "fixed" register values.

What would help here is to basically get a readable version of the unwind_info
gdb would produce if returning None from the unwinder. This would then enable
me to change directly at that point things, instead of going in that roundabout
way of saving a previous frame and then changing that... 

(hope that explains it, if not we can one day discuss it further on irc )

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-19 20:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03 15:16 [Bug python/28538] New: Consider adding possibility to call gdb unwinder for the heavy lifting plasmahh at gmx dot net
2022-02-19 16:08 ` [Bug python/28538] " tromey at sourceware dot org
2022-02-19 20:32 ` plasmahh at gmx dot net

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