----------------------------------------------------------------------------
| 4867 | } |
| 4868 | //---------------------------------------------------------------------------- |
| 4869 | void loadGameDebugBreakpoints(void) |
| 4870 | { |
| 4871 | int i,j; |
| 4872 | FILE *fp; |
| 4873 | char stmp[512]; |
| 4874 | char id[64], data[128]; |
| 4875 | std::string fileName; |
| 4876 | |
| 4877 | // If no debug windows are open, skip loading breakpoints |
| 4878 | if ( dbgWin == NULL ) |
| 4879 | { |
| 4880 | printf("No Debug Windows Open: Skipping loading of breakpoint data\n"); |
| 4881 | return; |
| 4882 | } |
| 4883 | if ( getGameDebugBreakpointFileName( fileName ) ) |
| 4884 | { |
| 4885 | printf("Error: Failed to get load file name for debug\n"); |
| 4886 | return; |
| 4887 | } |
| 4888 | |
| 4889 | //printf("Debug Load File: '%s' \n", fileName.c_str() ); |
| 4890 | |
| 4891 | fp = fopen( fileName.c_str(), "r"); |
| 4892 | |
| 4893 | if ( fp == NULL ) |
| 4894 | { |
| 4895 | printf("Warning: Failed to open file '%s' for reading\n", fileName.c_str() ); |
| 4896 | return; |
| 4897 | } |
| 4898 | |
| 4899 | while ( fgets( stmp, sizeof(stmp), fp ) != 0 ) |
| 4900 | { |
| 4901 | i=0; j=0; |
| 4902 | |
| 4903 | while ( isspace(stmp[i]) ) i++; |
| 4904 | |
| 4905 | while ( isalnum(stmp[i]) ) |
| 4906 | { |
| 4907 | id[j] = stmp[i]; j++; i++; |
| 4908 | } |
| 4909 | id[j] = 0; |
| 4910 | |
| 4911 | while ( isspace(stmp[i]) ) i++; |
| 4912 | |
| 4913 | if ( stmp[i] != ':' ) |
| 4914 | { |
| 4915 | continue; |
| 4916 | } |
| 4917 | i++; |
| 4918 | while ( isspace(stmp[i]) ) i++; |
| 4919 | |
| 4920 | if ( strcmp( id, "BreakPoint" ) == 0 ) |
| 4921 | { |
| 4922 | int retval; |
| 4923 | int start_addr = -1, end_addr = -1, type = 0, enable = 0; |
| 4924 | char cond[256], desc[256]; |
| 4925 | |
| 4926 | cond[0] = 0; desc[0] = 0; |
no test coverage detected