Title: Can't run program with debugger? Post by: Bryce S. on March 04, 2008, 08:37:28 pm Hi,
I thought I'd take a look at using the debugger. However when I run a program with the -d flag it behaves as though the program has not been linked saying: The function '<fnc_name>' has not been defined in any module in the program. It does this for all functions referenced in other modules linked to program. If I run the program without the -d flag it runs normally showing it is all linked correctly. Anyone have any ideas on what I need to do to get this working?' We're using genero 2.02.02 on a windows platform. Example output: D:\systestg>fglrun -d rbm01x The function 'get_raceday_rec' has not been defined in any module in the program. The function 'actual_placing' has not been defined in any module in the program. The function 'placing_to_str4' has not been defined in any module in the program. The function 'placing_to_str3' has not been defined in any module in the program. The function 'barrier_draw_to_screen' has not been defined in any module in the program. The function 'format_favouritism_to_str' has not been defined in any module in the program. The function 'get_track_condition_for_race' has not been defined in any module in the program. The function 'calculate_age_and_sex2' has not been defined in any module in the program. The function 'raceday_last_updated_date_time' has not been defined in any module in the program. The function 'any_raceday_updated_recently' has not been defined in any module in the program. (fgldb) Regards, Bryce Stenberg Harness Racing New Zealand Inc. Title: Re: Can't run program with debugger? Post by: Reuben B. on March 04, 2008, 09:46:23 pm Bryce,
If you type run at the (fgldb) prompt, does the program still run? Anyway here is a small example that illustrates what is happening. Code
Compile and link together. You should find that fglrun works and fglrun -d reports "The function 'c' has not been defined in any module in the program". Why does it do this? well with fglrun, the function b() can never be executed so the linker hasn't linked its child functions that exist in other modules in the program, however in the debugger it is possible to type call b() hence the warning. Reuben Title: Re: Can't run program with debugger? Post by: Rene S. on March 05, 2008, 11:52:35 am Hello,
the reported problem only happens for functions called in unused modules: the linker (fglrun -l) resolves references to functions only, if the module defining the function is really used. In older versions of the linker, only used functions are listed in the resulting name.42r file. Unfortunately we have this weakness in language: ui.Form.setDefaultInitializer(String initializer) ui.ComboBox.setDefaultInitializer(String initializer) Both methods have a parameter initializer which is the name of a fgl-function. The compiler doesn't see a reference to this function. Since this problem the linker lists also "unused" functions in the output file. The reported problem looks like a linker bug. Resolving this bug could break compatibility: a fgl-library (*.42x) may contain modules with unresolved symbols (behaves like a c-library). When linking all unused modules must be ignored. I wonder, that this problem has never been reported before. You can solve this problem by removing unused modules from the link list. You can not solve this problem when using libraries. Rene Title: Re: Can't run program with debugger? Post by: Bryce S. on March 05, 2008, 11:05:10 pm Hi,
I understand it now and have it working. I'm just ignoring the warnings (I thought they were errors), but now I see I just need to type 'run' and have my breakpoints set. thanks for your help, Regards, Bryce Stenberg. |