<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Thanks. That's useful info that covers the "squishing" of C frames into Python frames. <br class="">
<div><br class="">
</div>
<div>The link to the slides at the end also mentions two other useful projects for walking the stack, py-spy and pyflame.</div>
<div><br class="">
</div>
<div>Having said that, I'm more interested on the "lldb" side of things.</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 20. Nov 2018, at 18:45, Leonard Mosescu <<a href="mailto:mosescu@google.com" class="">mosescu@google.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div dir="ltr" class="">Not strictly related to LLDB but you might find this interesting: <a href="https://blogs.dropbox.com/tech/2018/11/crash-reporting-in-desktop-python-applications" class="">https://blogs.dropbox.com/tech/2018/11/crash-reporting-in-desktop-python-applications</a> </div>
</div>
<br class="">
<div class="gmail_quote">
<div dir="ltr" class="">On Tue, Nov 20, 2018 at 8:51 AM Alexandru Croitor via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a>> wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br class="">
<br class="">
It's been a while since I asked this question on the mailing list ( 2~ years ago).<br class="">
<br class="">
I am interested in what would be the current best way for implementing interleaved / mixed-mode Python backtraces when debugging the CPython interpreter.<br class="">
<br class="">
So if I run lldb -- python /path/to/my/script, set a breakpoint somewhere in the C code, and then do "bt", I would see a list of both C stack frames and Python stack frames, and if I do "frame select x" for a python frame, I could inspect the Python locals
for instance.<br class="">
<br class="">
Last time I asked, Jim mentioned using a custom "thread provider". Would this still be the way to go?<br class="">
<br class="">
I also saw mentions of Java / Go support in the VCS log, but the support was removed due to no maintainers, so I don't know if that would also be the best way of doing it for Python.<br class="">
<br class="">
I would appreciate, if someone could point me to some relevant code that does something similar to what I'm asking, so I could use it as a base point for exploration.<br class="">
<br class="">
Many thanks.<br class="">
<br class="">
> On 8. Jul 2016, at 12:24, Alexandru Croitor <<a href="mailto:alexandru.croitor@qt.io" target="_blank" class="">alexandru.croitor@qt.io</a>> wrote:<br class="">
> <br class="">
> Thanks for replying, it's good to know what the status is at least, as well as how it's done in GDB.<br class="">
> <br class="">
>> On 06 Jul 2016, at 20:56, Jim Ingham <<a href="mailto:jingham@apple.com" target="_blank" class="">jingham@apple.com</a>> wrote:<br class="">
>> <br class="">
>> Nothing of this sort has been done to my knowledge, and I haven't heard of any plans to do so either.<br class="">
>> <br class="">
>> It should certainly be possible, you just need to grub the C stack and recognize the pattern of a Python stack frame in it and where said frame stashes away the arguments & locals, and then re-present it as a Python frame. The SB API's should make that
fairly straight forward.<br class="">
>> <br class="">
>> It looks like the Python work in gdb is based on a generic "frame filter" concept in the gdb Python API's. That's something Greg and I talked about when working on gdb way back, and has been a future goal for lldb from the start, but it hasn't ever gotten
beyond discussion to date. We already have the notion of a "thread provider" which allows the Mach Kernel plugin to present its activations as threads in lldb. You could do much the same thing in lldb, where a thread would have the native unwind based stack
frame and then pluggable StackFrame provider that would show different representations of the stack.<br class="">
>> <br class="">
>> If anybody is interested in taking on such a project, that would be very cool.<br class="">
>> <br class="">
>> Jim<br class="">
>> <br class="">
>>> On Jul 6, 2016, at 8:48 AM, Alexandru Croitor via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank" class="">lldb-dev@lists.llvm.org</a>> wrote:<br class="">
>>> <br class="">
>>> Hello,<br class="">
>>> <br class="">
>>> I've searched for information wether it is possible to debug a python script using LLDB, and haven't found anything so far.<br class="">
>>> <br class="">
>>> Specifically I'm interested in an LLDB counterpart to what GDB provides (the two main pages being
<a href="https://wiki.python.org/moin/DebuggingWithGdb" rel="noreferrer" target="_blank" class="">
https://wiki.python.org/moin/DebuggingWithGdb</a> and <a href="http://fedoraproject.org/wiki/Features/EasierPythonDebugging" rel="noreferrer" target="_blank" class="">
http://fedoraproject.org/wiki/Features/EasierPythonDebugging</a> ).<br class="">
>>> <br class="">
>>> So python stack traces, python values, etc.<br class="">
>>> <br class="">
>>> I assume this is not implemented, but are there any plans, or is it even feasible to implement?<br class="">
>>> <br class="">
>>> Regards, Alex.<br class="">
>>> _______________________________________________<br class="">
>>> lldb-dev mailing list<br class="">
>>> <a href="mailto:lldb-dev@lists.llvm.org" target="_blank" class="">lldb-dev@lists.llvm.org</a><br class="">
>>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank" class="">
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br class="">
>> <br class="">
> <br class="">
<br class="">
_______________________________________________<br class="">
lldb-dev mailing list<br class="">
<a href="mailto:lldb-dev@lists.llvm.org" target="_blank" class="">lldb-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br class="">
</blockquote>
</div>
</div>
</blockquote>
</div>
<br class="">
</body>
</html>