| Re: [hatari-devel] Building Hatari from sources (debugger output issue) | 
[ Thread Index | 
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
] 
Hi,
On perjantai 01 helmikuu 2013, laurent.sallafranque@xxxxxxx wrote:
> In complement, if this can help t understand the problem, if I enter the
> command dd, I get the following in the console :
> 
> dd
> DSP disasm 0x51-0x59:
> dd
> DSP disasm 0x59-0x61:
> dd
> DSP disasm 0x61-0x69:
> 
> 
> So the text DSP disasm... displays in the console, but not the result of
> the command.
> 
> Maybe this will be of any help.
Yes.  Above means that stdout goes to console, but stderr doesn't [1].
Both definitely should go to console.
I think the problem is this in src/gui-win/opencon.c:
----------------------------
void Win_OpenCon(void)
{
        if (!bExceptionDebugging)
                return;
        AllocConsole();
        freopen("CON", "w", stdout);
        freopen("CON", "r", stdin);
        freopen("CON", "wr", stderr);
}
----------------------------
Last may fail because freopen() doesn't have a mode "wr"
(read & write modes are "r+", "w+" or "a+").
I changed that and added separate "-W" / "--wincon" options for
opening console on Windows.  I.e. "-D" doesn't anymore open
console on Windows, "-W" does:
http://hg.tuxfamily.org/mercurialroot/hatari/hatari/rev/bc086ca89534
Please test.
Note: the new configuration variable is there always, but the command
line option exists now only on Windows (WIN32).   If similar functionality
is added to some other platform, same config variable & options should be
used.
	- Eero
[1] Hatari debugger output is a bit inconsistent when it uses
	stdout, stderr or the log file.  I intended to fix/clean up
	that some day.