ebmDevMag.com home
ebm Developer's Magazine
links

developer's mag
main page

sections
part 1
part 2
part 3
part 4
part 5
part 6
part 7
part 8
part 9


7 - Debugging

7.01 - I get an error when compiling - undefined symbol: ebm_rand_kick__Fui
7.02 - Why are the MSG_TYPE values enums, not defines?
7.03 - What's are these files extensions all about?
7.04 - Can I use the emulator with my 'X' megahertz computer with chip 'Y' on Operating system 'Z'?
7.05 - Why not Win95?
7.06 - How fast should my computer be?
7.07 - What is the period in the debugger launch all about?
7.08 - My branch doesn't work in assembly language - why?
7.09 - How can I figure out my program's memory map?



7.01 - I get an error when compiling - undefined symbol: ebm_rand_kick__Fui
Looking at the error, you might be tempted to think the '_Fui' is personal. It isn't. You're looking at name mangling; a way the compiler converts C++ object files to work with C object files. Look up a reference on name mangling to get a good overview (it can get deep into the nuts and bolts of C/C++ compiling) but the way around it is simple. For every header that contains the declaration that is giving you grief, wrap it in an extern clause wherever you #include it. For example:

extern "C"
{
#include "timer.h"
}


7.02 - Why are the MSG_TYPE values enums, not defines?
Two advantages - the debugger can show you the value of the enum, and case statements do extra checking on enums. If you've coded a message loop and been warned that a specific enum hasn't been handled, then you've seen the additional benefits it brings.

7.03 - What's are these files extensions all about?
Some the general programming extensions are:
  • *.c - C file (not generally C++)
  • *.cpp - C++ file
  • *.fxe - Franklin excutable format
  • *.h - header file - usually definitions other pieces of code needed for reference
  • *.o - object file - a piece of the finished program
  • *.s - Franklin assembly source code file
  • *.seb - Franklin file packaging format


7.04 - Can I use the emulator with my 'X' megahertz computer with chip 'Y' on Operating system 'Z'?
From personal experience, I can state that the emulator does work on Windows 98 (not 95), with both Intel and AMD processors, and at speeds from 233 to 850mhz. Your mileage may vary.

7.05 - Why not Win95?
USB support was not as complete in Windows 95 (even including the USB support found in OSR release 2). As such, Franklin decided to release programs to run on Win98 and up.

7.06 - How fast should my computer be?
Let's face it - there's no such thing as 'fast enough' in computers. As far as the emulator, I've debugged on a 233mhz machine, but didn't enjoy it. At 850, I have no problems at all. If that's enough to convince your significant other that you need to upgrade, then go for it.

7.07 - What is the period in the debugger launch all about?
The command ./sGDB is typical Linux - the period/slash indicates that the local directory should be searched for the file, rather than the PATH environment variable. Since there can be more than one program in the system, this makes it obvious you want the local sGDB only to be executed.

7.08 - My branch doesn't work in assembly language - why?
An ldt (or ldo, ldc, lda, etc) must be executed immediately before the conditional branch for it to work, because of the K flag. Otherwise, it will be interpreted as another instruction.

7.09 - How can I figure out my program's memory map?
Your program .map file (created during compilation) gives you some information about layout.



Previous Section
Next Section

Copyright © 2001-2006 ebmDevMag.com - Legal Notice