I am having trouble with debugging. I have follow the instructions in the debugging tutorial video as well as read the NBEclipse Getting Started Guide.
So here is a list of the symptoms. If anyone has any suggestions on how to do things properly or advice that might lead me in the right direction I would appreciate it.
1) Using the factory program in NBEclipse (imported using the instructions in the getting started guide). Anything in the #ifdef _DEBUG macro is greyed out. I put #define _DEBUG 1 at the very top of my program. This compiles in the InitializeNetworkGDB() function however the launching appears to work the first time however the break points do not get tripped and most turn into exclamation points with a "Unresolved Breakpoint" message. Clicking the debug button again the launching pauses for a long time at %2 and everytime after asks me if I am sure I want to build because it is already debugging.
I have successfully run the program using the run configuration and my debug config is set with the same IP address and I have set the Active build configuraiton to Debug.
2) Using the Debug application wizard example. The InitializeNetworkGDB_and_Wait() function yields an error as "Undefined Reference"... which usually means it is not in the library or cpp file or what not. I have no idea how to go finding it as I don't have the source to where ever the functions from NetworkDebug.h come from (or do I?). Compiling and running/debugging with InitializeNetworkGDB() yields a situation where I cannot use AutoUpdate anymore without logging in using the MTTY terminal and using AutoUpdate() manually to go to the "NB" prompt and loading the factory program from there.
So I think my questions are:
A) How is the _DEBUG defines properly used?
B) What could I have missed to cause the debugger not to connect or cause the launching issues I have described in 1 and 2?
Thanks,
Chris F.
Debugging MOD54415
Re: Debugging MOD54415
Rather than jumping to a complex example like the factory demo, did you try the step by step debugging section in the getting started guide? That was a good start for me. You seem to have other tickets with virus/firewall/mcaffee issues. The debugger uses network communication too, so once you get it to compile it may still not be able to connect due to all the anti virus stuff you have going.
Re: Debugging MOD54415
I appreciate your reply. I will iterate over my answers:
A) The IPSetup issue is solved. It was a problem with the broadcast packets being sent to the Microsoft Loopback installed.
B) I can communicate with the board over ethernet normally. Ping works in both directions. IPSetup works now. The factory demo works fine as I can use the HTTP server just fine. So I believe there are no network issues.
C) McAfee is gone/uninstalled. Windows Firewall is OFF. Microsoft Loopback is disabled.
D) I have tried the debugging example generated by the NetBurner AppWizard... however I get an error when trying to compile where the linker tells me there is an undefined reference to InitializeNetworkGDB_and_Wait(); so I replace it with InitializeNetworkGDB() instead.
I just tried the example in the "NBEclipse Getting Started" guide. I still get the undefined reference to InitializeNetworkGDB_and_Wait();
I did some experimentation and I think I am beginning to sort out the issues. I seem to have a few.
1) The debugger does not exit all on its own... I get failure to interrupt errors.. until I go into the task manager in windows and kill it. Then I can debug again. Even if I terminate it in Eclipse.
2) It appears that if I do not use the existing code in the Factory app for getting the IP address (using a static IP or DHCP) which consists of:
and I use instead the code from the AutoIP example:
I get some weirdness where the debugger wants to debug into some code it has not source code for despite not having any break points.
3) It is imperative that your program in order to debug it have code for: AutoUpdate, NetworkDebug, and DHCP checked for the Netburner Wizard. I overlooked the DHCP checkbox although I do not know why it matters with a static IP. I probably was caught up in a bunch of errors an overlooked something else.
I think it is working well enough to use now.
Thanks for your help.
,Chris F.
A) The IPSetup issue is solved. It was a problem with the broadcast packets being sent to the Microsoft Loopback installed.
B) I can communicate with the board over ethernet normally. Ping works in both directions. IPSetup works now. The factory demo works fine as I can use the HTTP server just fine. So I believe there are no network issues.
C) McAfee is gone/uninstalled. Windows Firewall is OFF. Microsoft Loopback is disabled.
D) I have tried the debugging example generated by the NetBurner AppWizard... however I get an error when trying to compile where the linker tells me there is an undefined reference to InitializeNetworkGDB_and_Wait(); so I replace it with InitializeNetworkGDB() instead.
I just tried the example in the "NBEclipse Getting Started" guide. I still get the undefined reference to InitializeNetworkGDB_and_Wait();
I did some experimentation and I think I am beginning to sort out the issues. I seem to have a few.
1) The debugger does not exit all on its own... I get failure to interrupt errors.. until I go into the task manager in windows and kill it. Then I can debug again. Even if I terminate it in Eclipse.
2) It appears that if I do not use the existing code in the Factory app for getting the IP address (using a static IP or DHCP) which consists of:
Code: Select all
if ( EthernetIP == 0 )
{
iprintf( "Trying DHCP...\r\n" );
GetDHCPAddress();
iprintf( "DHCP assigned the IP address of: " );
ShowIP( EthernetIP );
iprintf( "\r\n" );
}
else
{
iprintf( "Static IP address: " );
ShowIP( EthernetIP );
iprintf( "\r\n" );
}
Code: Select all
/*-------------------------------------------------------------------
* Wait for DHCP Address Assignment
* This function is optional. In some instances you may want to
* wait for a DHCP address before continuing in your program.
*-----------------------------------------------------------------*/
void WaitForLinkAndAddress()
{
// Wait for Ethernet link to be established
WORD ncounts = 0;
// This will wait forever, so long as the device lacks an ethernet link.
// Uncomment the end of the line to put a delay limit in.
while ( ( !EtherLink() ) ) //&& ( ncounts < 6*TICKS_PER_SECOND ) )
{
ncounts++;
OSTimeDly( 1 );
}
#ifdef _DEBUG_PRINT
iprintf( "--------------------------------------------------\r\n" );
iprintf( " Got etherlink: %d\r\n", ncounts );
iprintf( "--------------------------------------------------\r\n" );
#endif
// Check to see if our IP address is 0.0.0.0 ...
// in which case we will do DHCP and AutoIP
if ( EthernetIP == 0 )
{
int interface = GetFirstInterface();
int rv = GetDHCPAddress( interface );
if ( rv == DHCP_FAILED )
{
DoAutoIP(interface);
#ifdef _DEBUG_PRINT
iprintf( "--------------------------------------------------\r\n" );
iprintf( " Falling back to AutoIP\r\n" );
iprintf( "--------------------------------------------------\r\n" );
#endif
}
else
{
#ifdef _DEBUG_PRINT
iprintf( "--------------------------------------------------\r\n" );
iprintf( " Got DHCP address\r\n" );
iprintf( "--------------------------------------------------\r\n" );
#endif
}
iprintf( "--------------------------------------------------\r\n" );
iprintf( " Current IP: " );
ShowIP( GetInterFaceBlock( interface )->netIP );
iprintf( " Current Subnet: " );
ShowIP( GetInterFaceBlock( interface )->netIpMask );
iprintf( "\r\n" );
iprintf( "--------------------------------------------------\r\n" );
}
}
3) It is imperative that your program in order to debug it have code for: AutoUpdate, NetworkDebug, and DHCP checked for the Netburner Wizard. I overlooked the DHCP checkbox although I do not know why it matters with a static IP. I probably was caught up in a bunch of errors an overlooked something else.
I think it is working well enough to use now.
Thanks for your help.
,Chris F.
Re: Debugging MOD54415
So I have one more questions about the debugging....
Why does the InitializeNetworkGDB_and_Wait(); function give me an undefined reference linker error? I could really use that function. If I cannot use it are there alternatives to detect the attachment of the debugger or should I just put in a delay that I determine from experimentation?
Why does the InitializeNetworkGDB_and_Wait(); function give me an undefined reference linker error? I could really use that function. If I cannot use it are there alternatives to detect the attachment of the debugger or should I just put in a delay that I determine from experimentation?
Re: Debugging MOD54415
Great summary, that really entices people to spend some time and try to help. I ran the app wizard test and it worked for me. Here is what I did:
My release is 2.6.20
Created app wizard project, selected dhcp, debug, web server, autoupdate
Project built fine
Right-click on project, select BuildConfigurations -> SetActive -> Debug
Project build fine in debug mode
My release is 2.6.20
Created app wizard project, selected dhcp, debug, web server, autoupdate
Project built fine
Right-click on project, select BuildConfigurations -> SetActive -> Debug
Project build fine in debug mode
Re: Debugging MOD54415
I did that too after your suggestion. At first I ignored all of the other options besides network debug and it did not work. Be sure to put in at least AutoUpdate, Network Debug, and DHCP. You can ignore the web server.
The m68k-elf-gdb.exe still hangs or at least refuses to exit on its own occasionally. I get a failed to interrupt error when that happens. But all you do there is just kill it using the Windows task manager.
I am using:
In place of the InitializeNetworkGDB_and_Wait(); call since it is still unreferenced (probably missing from the library). I can now put a break point right after the above debugging init code and it trips reliably.
I am having trouble entering break points live... but I am not sure I am supposed to be able to to that...
Thanks for your help.
Chris F.
The m68k-elf-gdb.exe still hangs or at least refuses to exit on its own occasionally. I get a failed to interrupt error when that happens. But all you do there is just kill it using the Windows task manager.
I am using:
Code: Select all
// Enable debugging if we need to
#ifdef _DEBUG
// Initialize network debugging
InitializeNetworkGDB();//_and_Wait();
// Wait 5 seconds for the debugger to attach
OSTimeDly(TICKS_PER_SECOND * 5);
#endif
I am having trouble entering break points live... but I am not sure I am supposed to be able to to that...
Thanks for your help.
Chris F.
Re: Debugging MOD54415
I have similar issues. InitializeNetworkGDB_and_Wait() is undefined.
I am unable to set breakpoints in the MOD54415 factory app. It says:
Multiple markers at this line
- Unresolved breakpoint
- Line breakpoint: webfuncs.cpp
[line: 175]
The Debug window shows 7 threads as running, so the debugger would appear to have connected (there is no indication that it cannot).
I also have the issue where the debugger process does not terminate and I have to kill it off with Task Manager.
I am running Windows 7 x64.
I would also point out that documentation for the MOD54415 is distinctly lacking; there is nothing for it in the \nburn\docs\platform directory.
I am unable to set breakpoints in the MOD54415 factory app. It says:
Multiple markers at this line
- Unresolved breakpoint
- Line breakpoint: webfuncs.cpp
[line: 175]
The Debug window shows 7 threads as running, so the debugger would appear to have connected (there is no indication that it cannot).
I also have the issue where the debugger process does not terminate and I have to kill it off with Task Manager.
I am running Windows 7 x64.
I would also point out that documentation for the MOD54415 is distinctly lacking; there is nothing for it in the \nburn\docs\platform directory.