Interactive debugging and live data inspection

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Interactive debugging and live data inspection

Stephen R. van den Berg
I just checked in a debugging aid I created to be able to do some
live data inspection in running Pike programs (I used it to find the
cause of a deadlock in pgsql).

I'd appreciate feedback on the implementation and usability of Debug.Peek
(in Pike 8.1).

To get a rough impression of what it does, here's an excerpt out of the
documentation:

------------------------------------------------
Class Debug.Peek

Description
Allows for interactive debugging and live data structure inspection in both single- and multi-threaded programs. Creates an independent background thread that every pollinterval will show a list of running threads. Optionally, a triggersignal can be specified which allows the dump to be triggered by signal.

Example: In the program you'd like to inspect, insert the following one-liner:

Debug.Peek("/tmp/test.pike");
Then start the program and keep it running. Next you create a /tmp/test.pike with the following content:

void create() {
 werror("Only once per modification of test.pike\n");
}

int main() {
 werror("This will run every iteration\n");
 werror("By returning 1 here, we disable the stacktrace dumps\n");
 return 0;
}

void destroy() {
 werror("destroy() runs just as often as create()\n");
}
Whenever you edit /tmp/test.pike, it will automatically reload the file.
------------------------------------------------
--
Stephen.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Interactive debugging and live data inspection

Stephen R. van den Berg
Stephen R. van den Berg wrote:
>I just checked in a debugging aid I created to be able to do some
>live data inspection in running Pike programs (I used it to find the
>cause of a deadlock in pgsql).

>I'd appreciate feedback on the implementation and usability of Debug.Peek
>(in Pike 8.1).

I polished it a bit, since the initial commit.
Works very robust for me.

Any reason I should not copy this over to 8.0?
--
Stephen.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Interactive debugging and live data inspection

Peter Bortas-2
Debug is not considered part of the stable API, so if it's useful it
can be backported without much extra thought unless Grubba has
objections. Hold on that until after the next release though. I don't
want extra churn less than a week before the build.

Regards,
--
Peter Bortas, NSC

On Tue, Jun 27, 2017 at 12:53 PM, Stephen R. van den Berg <[hidden email]> wrote:

> Stephen R. van den Berg wrote:
>>I just checked in a debugging aid I created to be able to do some
>>live data inspection in running Pike programs (I used it to find the
>>cause of a deadlock in pgsql).
>
>>I'd appreciate feedback on the implementation and usability of Debug.Peek
>>(in Pike 8.1).
>
> I polished it a bit, since the initial commit.
> Works very robust for me.
>
> Any reason I should not copy this over to 8.0?
> --
> Stephen.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Interactive debugging and live data inspection

Peter Bortas-2
Well. I see it's already in. I'm not going to ask you to back it out.

/Peter

On Wed, Jun 28, 2017 at 6:28 PM, Peter Bortas <[hidden email]> wrote:

> Debug is not considered part of the stable API, so if it's useful it
> can be backported without much extra thought unless Grubba has
> objections. Hold on that until after the next release though. I don't
> want extra churn less than a week before the build.
>
> Regards,
> --
> Peter Bortas, NSC
>
> On Tue, Jun 27, 2017 at 12:53 PM, Stephen R. van den Berg <[hidden email]> wrote:
>> Stephen R. van den Berg wrote:
>>>I just checked in a debugging aid I created to be able to do some
>>>live data inspection in running Pike programs (I used it to find the
>>>cause of a deadlock in pgsql).
>>
>>>I'd appreciate feedback on the implementation and usability of Debug.Peek
>>>(in Pike 8.1).
>>
>> I polished it a bit, since the initial commit.
>> Works very robust for me.
>>
>> Any reason I should not copy this over to 8.0?
>> --
>> Stephen.
Loading...