Re: [BLACKBOX] Debugging dll accessing programs

From: [at]} <Frank>
Date: Mon, 14 Mar 2011 23:46:49 -0300

----boundary-LibPST-iamunique-2090651077_-_-
Content-type: text/plain

On 03/14/2011 03:27 PM, Josef Templ wrote:

> Are you sure that the [ccall] option is required?

Actually, no. Those bbox-components indicated by romiras use [ccal], so
I did the same. Meanwhile I tried without, but the trap persists.

> The docu (Dev/Docu/P-S-I.odc) says that no special handling is required for
> callback procedures.
> Please read the said document very carefully.

Did so and will do again.

> Check the parameter list and the involved data types.
> It is not always an easy task to call external procedures successfully.

So let me ask about a specific case:
Some Gtk structs contain arrays. A C array variable is a pointer to the
first array element. So it should translate to Component Pascal as
        POINTER TO ARRAY [untagged] <size> OF <base type>
Correct?

> The <system> lines refer to procedures on the call stack that
> are 'outside' of BlackBox, i.e. that have no debugging information
> available for the BlackBox trap handler.
> In this case, it displays all it knows, which is the program counter (pc)
> and the frame pointer (fp).

 From your answer I deduce that these data aren't of much use for a
simple application programmer. Debugging consists of staring at the
source code in such a case, correct?

-- 
Frank Hrebabetzky		+55 / 48 / 3235 1106
Florianopolis, Brazil
> ----- Original Message ----- From: "Frank Hrebabetzky" <hreba{([at]})nowhere.xy> To: <BLACKBOX{([at]})nowhere.xy> Sent: Monday, March 14, 2011 1:11 PM
> Subject: [BLACKBOX] Debugging dll accessing programs
>
>
>> Hi all,
>>
>> I wrote a simple test program which uses gtk and calls an expose event
>> handler. I first wrote a C version, which works fine, and translated
>> it then line by line to Component Pascal. My interface modules were
>> strongly inspired from a link (which I don't remember (is there an
>> archive of this list?)) from romiras.
>>
>> Execution results in the trap shown below. The call to Gdk.draw_arc is
>> marked.
>>
>> My problems are:
>> 1. The components of noaligned or untagged records and arrays cannot
>> be displayed in trap windows
>> 2. I have no idea what to do with those <system> lines.
>>
>> So how do I debug this?
>>
>> ---------------------------------------------------------------------
>> illegal memory read (ad = DADADCDCH)
>>
>> GtkDraw.Expose [00000074H]
>> .data POINTER NIL
>> .event POINTER [0022E320H]
>> .widget POINTER [62EAC580H]
>> <system> (pc=63B6A099H, fp=0022DF90H)
>> <system> (pc=63A45AC9H, fp=0022E010H)
>> <system> (pc=63A5698FH, fp=0022E0F0H)
>> <system> (pc=63A5DE8DH, fp=0022E210H)
>> <system> (pc=63A5E1F5H, fp=0022E230H)
>> <system> (pc=63C8A2BEH, fp=0022E290H)
>> <system> (pc=63B68A06H, fp=0022E2F0H)
>> <system> (pc=6C363FF0H, fp=0022E390H)
>> <system> (pc=6C363FA4H, fp=0022E430H)
>> <system> (pc=6C35F4D1H, fp=0022E4A0H)
>> <system> (pc=6C3612AAH, fp=0022E4E0H)
>> <system> (pc=6C36131AH, fp=0022E4F0H)
>> <system> (pc=6C34137BH, fp=0022E520H)
>> <system> (pc=685F09EAH, fp=0022E5A0H)
>> <system> (pc=685F1204H, fp=0022E620H)
>> <system> (pc=685F1740H, fp=0022E660H)
>> <system> (pc=63B6780FH, fp=0022E6C0H)
>> GtkDraw.Main [00000155H]
>> .argc POINTER NIL
>> .argv POINTER NIL
>> .drawingArea POINTER [62EAC580H]
>> .window POINTER [62EAE000H]
>> Kernel.Call [00001A63H]
>> .adr INTEGER 1652490770
>> ...
>> ---------------------------------------------------------
>>
>> with GtkDraw.Expose being:
>>
>> ---------------------------------------------------------
>>
>> PROCEDURE [ccall] Expose (
>> widget: Gtk.WidgetP; event: Gdk.EventExposeP; data: G.pointer):
>> G.boolean;
>> BEGIN
>> (**) Out.String("widget.state="); Out.Int(ORD(widget.state),0); Out.Ln;
>> Gdk.draw_arc (
>> widget.window, widget.style.fg_gc[ORD(widget.state)],
>> G.TRUE, 0, 0, widget.allocation.width, widget.allocation.height,
>> 0, 64 * 360);
>> Out.String ("expose_event"); Out.Ln;
>> RETURN G.TRUE;
>> END Expose;
>>
>> -------------------------------------------------------------
>> --
>> Frank Hrebabetzky +55 / 48 / 3235 1106
>> Florianopolis, Brazil
>>
>>
>> ----
>> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
>> LISTSERV{([at]})nowhere.xy>
>
> ----
> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
> LISTSERV{([at]})nowhere.xy>
>
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-2090651077_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIE9uIDAzLzE0LzIwMTEgMDM6MjcgUE0sIEpvc2Vm
IFRlbXBsIHdyb3RlOlxwYXINClxwYXINCj4gQXJlIHlvdSBzdXJlIHRoYXQgdGhlIFtjY2FsbF0g
b3B0aW9uIGlzIHJlcXVpcmVkP1xwYXINClxwYXINCkFjdHVhbGx5LCBuby4gVGhvc2UgYmJveC1j
b21wb25lbnRzIGluZGljYXRlZCBieSByb21pcmFzIHVzZSBbY2NhbF0sIHNvIFxwYXINCkkgZGlk
IHRoZSBzYW1lLiBNZWFud2hpbGUgSSB0cmllZCB3aXRob3V0LCBidXQgdGhlIHRyYXAgcGVyc2lz
dHMuXHBhcg0KXHBhcg0KPiBUaGUgZG9jdSAoRGV2L0RvY3UvUC1TLUkub2RjKSBzYXlzIHRoYXQg
bm8gc3BlY2lhbCBoYW5kbGluZyBpcyByZXF1aXJlZCBmb3JccGFyDQo+IGNhbGxiYWNrIHByb2Nl
ZHVyZ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2013 - 06:30:17 UTC