Debugging code that shows no errors...

This forum is for general developer support questions.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 534
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland
Contact:

Re: Debugging code that shows no errors...

Post by salass00 »

@belxjander
dApplication.IApplication = (APTR)IExec->GetInterface((APTR)dApplication.ApplicationBase,"main",0L,NULL);
The name of the IApplication interface is "application" and not "main". Unlike most libraries "application.library" does not have an interface named "main" at all.

Also when using the GetInterface() function you should always specify the exact version you want (specifying 1 as version should be fine for most libraries) as there is no 0 value for "any version works" as there is with OpenLibrary().

The reason is that unlike library versions which should always try to be backwards compatible, interface versions will most likely be incompatible and a library can export more than one version of the same interface (f.e. a library might export v1 "main" interface with compatibility cludges for old applications and an improved v2 "main" for newer ones).
User avatar
trixie
Posts: 411
Joined: Thu Jun 30, 2011 3:54 pm
Location: Czech Republic

Re: Debugging code that shows no errors...

Post by trixie »

@belxjander
salass00 wrote: The name of the IApplication interface is "application" and not "main". Unlike most libraries "application.library" does not have an interface named "main" at all.
Yes. This is all well covered in the relevant section of the Amiga Developer Wiki.
The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Belxjander
Posts: 315
Joined: Mon May 14, 2012 11:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: Debugging code that shows no errors...[SOLVED]

Post by Belxjander »

@Tonyw: Thank you for the reference debugging macro... I'll keep a note of it and use it in future.
I however don't have the luxury of anything other than the single sam440flex machine to work with...
so unless there is some way to run a serial debugging mechanism (using the FPGA with a custom program???) without using another device...
however much it is suggested to connect another device by serial link, I don't have any "second device" with which to read serial information.

@All: Thank you to everyone else as well... this is now solved...

Trying to code micro-snippets during "coffee breaks" using an android phone to copy/paste and modify code then later transferring it to the same for testing is a definite "bug infestation" helper...
User avatar
LyleHaze
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 525
Joined: Sat Jun 18, 2011 5:06 pm
Location: North Florida, near the Big Bend

Re: Debugging code that shows no errors...

Post by LyleHaze »

Have you had any success with sashimi?
Belxjander
Posts: 315
Joined: Mon May 14, 2012 11:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: Debugging code that shows no errors...[DEBUGGED]

Post by Belxjander »

LyleHaze wrote:Have you had any success with sashimi?
I have only added relevant debugging references into my projects, and due to comments on this thread managed to solve the bugs that were bothering me,

The processes embedded into the libraries I am writing can now proceed as Commodities and Application library presences are now active.

I hopefully don't need to add any workarounds for remapping keyboard events for keys that currently are present but non-functional for Japanese and other keyboards.
User avatar
LyleHaze
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 525
Joined: Sat Jun 18, 2011 5:06 pm
Location: North Florida, near the Big Bend

Re: Debugging code that shows no errors...

Post by LyleHaze »

I am glad you got it running..
I only asked about sashimi because of this comment:
so unless there is some way to run a serial debugging mechanism without using another device...
Which is exactly what sashimi offers you..

Have Fun!
Belxjander
Posts: 315
Joined: Mon May 14, 2012 11:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: Debugging code that shows no errors...

Post by Belxjander »

LyleHaze wrote:I am glad you got it running..
I only asked about sashimi because of this comment:
so unless there is some way to run a serial debugging mechanism without using another device...
Which is exactly what sashimi offers you..

Have Fun!
Well I will try to find time to actually read the Sashimi documentation and get it working then.

I am not making the best decisions or remembering all the details at the moment due to personal circumstances
User avatar
trixie
Posts: 411
Joined: Thu Jun 30, 2011 3:54 pm
Location: Czech Republic

Re: Debugging code that shows no errors...

Post by trixie »

@Belxjander
Belxjander wrote: Well I will try to find time to actually read the Sashimi documentation and get it working then.
There is really nothing to read! Just

Code: Select all

Run Sashimi CONSOLE BUFK=128 NOPROMPT ASKEXIT ASKSAVE
and you're done. When some debug output actually appears, Sashimi will open a window, and will also let you save the console buffer with the output.
The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Post Reply