RE: TTY debugger and the portray mechanism.

From: Stefano Novello <stefano.novello_at_parc-technologies.com>
Date: Thu 15 May 2003 10:03:33 AM GMT
Message-ID: <3E899FAFBF56D611B6A500508B9A9DA206E265@LON-SRV2>
Actually the way Josh was using portray, was intended to hide the internals
of some large data structures, that he didn't want to be visible when
debugging code outside of their home module.

A print depth that depended on whether the functor was a visible
struct/predicate/operator, i.e. one that hides data if it is in a structure
with an unknown functor, would:

a) Save him from defining a portray macro to hide the data
b) Allow him to define portray to show the data better where it was needed

Stefano

-----Original Message-----
From: Joachim Schimpf [mailto:j.schimpf@icparc.ic.ac.uk]
Sent: 14 May 2003 14:27
To: josh singer
Cc: 'eclipse-bugs@icparc.ic.ac.uk'
Subject: Re: TTY debugger and the portray mechanism.


josh singer wrote:
> 
> The second bug is that it is unpredictable in the TTY debugger whether
> compound terms get displayed using their portray predicate definitions or
> not. This seems to be an interaction between the TTY debugger, the module
> system and the portray mechanism.
> Here's an example.
> 
...
> [eclipse 6]: test_create(1, 2, 3, T), test_length([T], X).
>   (1) 1 CALL  test_create(1, 2, 3, T)   %> creep
>   (1) 1 EXIT  test_create(1, 2, 3, test(1))   %> creep
>   (2) 1 CALL  test_length([test(1)], X)   %> creep
>   (3) 2 CALL  length([test_struct_impl(1, 2, 3)], X)   %> skip
>   (3) 2 EXIT  length([test_struct_impl(1, 2, 3)], 1)   %> creep
>   (2) 1 EXIT  test_length([test(1)], 1)   %> creep
...
> 
> Maybe this is because the portray exported by test_module_b is not visible
> in test_module.

That's right. You have stepped into a different module context,
where the portray is not visible. Operator declarations and the like
will have similar behaviour.


> But this is to be expected, since test_module is often a
> low-level utility, which wouldn't be expected to know about the
> peculiarities of some application-specific data module (test_module_b).

I anyone has an idea how to do better, let me know!
With plain data structures, we don't have any module information
attached, i.e. we don't know in which module the data structure
was originally created, so we don't know where we should look
for a portray declaration.

In the special case (not yours) of goal-portrays (where the portrayed
date structure is actually a predicate call), we could actually do
better since we can look up the predicate's definition module.


-- 
 Joachim Schimpf              /             phone: +44 20 7594 8187
 IC-Parc                     /      mailto:J.Schimpf@imperial.ac.uk
 Imperial College London    /    http://www.icparc.ic.ac.uk/eclipse
Received on Thu May 15 11:05:57 2003

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:08:21 PM GMT GMT