Debug information not found

DOS specific questions.
Post Reply
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Debug information not found

Post by Dinosaur »

Hi all

I am compiling using a .bat file which has the following content.
Path C:\FBDos;
Cd\FBDos\Projects\Mc226
FBCDos -g -w pedantic -s console WinMain.bas -p c:\FBDos\Lib\Dos -v -l cgui204 -l alleg -x FrontEnd.exe
WinMain has a .bi file which includes the other basic modules.
#Include once "allegro.bi"
#Include once "cgui.bi"
#include Once "vbcompat.bi"
#Include once "Types.bi"
#Include once "declares.bi"
#Include once "Adam.bi"
#Include once "Presets.bi"
#Include Once "Win01.bas"
#Include Once "Win02.bas"
#Include Once "WinHelp.bas"
#Include Once "RunMod00.bas"
#Include Once "RunMod01.bas"
#Include Once "RunMod02.bas"
#LibPath "C:\HMI"
When I try to debug the message window has the following.
C:\FBDos\Projects\MC226>FBCDos -g -w pedantic -s console WinMain.bas -p c:\FBDos\Lib\Dos -v -l cgui204 -l alleg -x FrontEnd.exe
FreeBASIC Compiler - Version 0.90.1 (07-17-2013) for dos
Copyright (C) 2004-2013 The FreeBASIC development team.
standalone
compiling: WinMain.bas -o WinMain.asm (main module)
assembling: C:\fbdos\bin\dos\as.exe --32 "WinMain.asm" -o "WinMain.o"
ld options in 'temp.res': -o "FrontEnd.exe" -T "C:\fbdos\lib\dos\i386go32.x" -L "c:\FBDos\Lib\Dos" -L "C:\HMI" -L "C:\fbdos\lib\dos" -L "." "C:\fbdos\lib\dos\crt0.o" "C:\fbdos\lib\dos\fbrt0.o" "WinMain.o" "-(" -lcgui204 -lalleg -lfb -lgcc -lc -lm -lsupcx "-)"
linking: C:\fbdos\bin\dos\ld.exe @temp.res

Make done
Debugging: C:\FBDos\Projects\MC226\FrontEnd.exe
No debug info found. Compile with the -g option.
Is there a problem with the -g option in Dos ?
When I compile for windows it works perfectly.

Regards

EDIT: With the -g option the exe is 2,100kb , without it is 1,500kb. Yet no debug information found ???
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Debug information not found

Post by dkl »

When testing with a simple hello world and the gdb.exe from the FreeBASIC-0.90.1-dos package, it seems to be basically working (this is on Windows XP):
C:\>type 3.bas
print "hi!"

C:\>FreeBASIC-0.90.1-dos\fbc.exe 3.bas -g -v
FreeBASIC Compiler - Version 0.90.1 (07-17-2013) for dos
Copyright (C) 2004-2013 The FreeBASIC development team.
standalone
compiling: 3.bas -o 3.asm (main module)
assembling: C:\freeba~1.1-d\bin\dos\as.exe --32 "3.asm" -o "3.o"
ld options in 'temp.res': -o "3.exe" -T "C:\freeba~1.1-d\lib\dos\i386go32.x" -L "C:\freeba~1.1-d\lib\dos" -L "." "C:\freeba~1.1-d\lib\dos\crt0.o" "C:\freeba~1.1-d\lib\dos\fbrt0.o" "3.o" "-(" -lfb -lgcc -lc -lm -lsupcx "-)"
linking: C:\freeba~1.1-d\bin\dos\ld.exe @temp.res

C:\>FreeBASIC-0.90.1-dos\bin\dos\gdb.exe 3.exe
GNU gdb (GDB) 7.5.1
[...]
Reading symbols from c:/3.exe...done.
(gdb) b main
Breakpoint 1 at 0x1e80: file 3.bas, line 1.
(gdb) r
Starting program: c:/3.exe

Breakpoint 1, main (__FB_ARGC__=<error reading variable>,
__FB_ARGV__=<error reading variable>) at 3.bas:1
1 print "hi!"
(gdb) continue
Continuing.
hi!
[Inferior 1 (process 42) exited normally]
(gdb) q
Are you using a different debugger?
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: Debug information not found

Post by Dinosaur »

Hi All

dkl, I am also using XP, but using the built in debugger on FBEdit.
However, when I try it on FBDebugger I have the same result.

When I follow your example and use gdb, I get to the point where Reading symbols is done and it is waiting at
the gdb> prompt.
Have never used gdb, so will have to look and see what the commands are.
I have recently purchased and installed XP on a laptop and set everything up the way I normally do.

So, don't understand why FBDebugger works in Windows and not in dos.
Have copied projects from Dos to Win to prove that.

Regards
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Debug information not found

Post by dkl »

gdb commands: run or r to run the program, quit or q to quit. There's some more here: DebuggerRunning

Do FBEdit or FBDebugger support debugging DOS executables at all? They're Win32 programs afterall, so I imagine they support debugging Win32 executables, but perhaps not DOS ones.
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: Debug information not found

Post by Dinosaur »

Hi All

dkl, you may just have hit the nail on the head.
I re-read some of my old posts, and debugging dos with FBEdit or FB Debugger is the problem.

Luckily I can compile with Win or Dos without making any changes, so I guess I will have to debug in Win
and then compile to Dos for the end user.

Interestingly, the dos compiled app, works perfectly in XP. That is what made me think the debuggers should work on it as well.

Sorry to have wasted your time.

Regards
Post Reply