MCPcopy Create free account
hub / github.com/TASEmulators/fceux / saveGameDebugBreakpoints

Function saveGameDebugBreakpoints

src/drivers/Qt/ConsoleDebugger.cpp:4725–4799  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

4723}
4724//----------------------------------------------------------------------------
4725void saveGameDebugBreakpoints( bool force )
4726{
4727 int i;
4728 FILE *fp;
4729 char flags[8];
4730 debuggerBookmark_t *bm;
4731 std::string fileName;
4732
4733 // If no breakpoints are loaded, skip saving
4734 if ( !force && (numWPs == 0) && (dbgBmMgr.size() == 0) )
4735 {
4736 return;
4737 }
4738 if ( getGameDebugBreakpointFileName( fileName ) )
4739 {
4740 printf("Error: Failed to get save file name for debug\n");
4741 return;
4742 }
4743
4744 printf("Debug Save File: '%s' \n", fileName.c_str());
4745
4746 fp = fopen( fileName.c_str(), "w");
4747
4748 if ( fp == NULL )
4749 {
4750 printf("Error: Failed to open file '%s' for writing\n", fileName.c_str() );
4751 return;
4752 }
4753
4754 for (i=0; i<numWPs; i++)
4755 {
4756 flags[0] = (watchpoint[i].flags & WP_E) ? 'E' : '-';
4757
4758 if ( watchpoint[i].flags & BT_P )
4759 {
4760 flags[1] = 'P';
4761 }
4762 else if ( watchpoint[i].flags & BT_S )
4763 {
4764 flags[1] = 'S';
4765 }
4766 else if ( watchpoint[i].flags & BT_R )
4767 {
4768 flags[1] = 'R';
4769 }
4770 else
4771 {
4772 flags[1] = 'C';
4773 }
4774
4775 flags[2] = (watchpoint[i].flags & WP_R) ? 'R' : '-';
4776 flags[3] = (watchpoint[i].flags & WP_W) ? 'W' : '-';
4777 flags[4] = (watchpoint[i].flags & WP_X) ? 'X' : '-';
4778 flags[5] = (watchpoint[i].flags & WP_F) ? 'F' : '-';
4779 flags[6] = 0;
4780
4781 fprintf( fp, "BreakPoint: startAddr=%08X endAddr=%08X flags=%s condition=\"%s\" desc=\"%s\" \n",
4782 watchpoint[i].address, watchpoint[i].endaddress, flags,

Callers 4

CloseGameFunction · 0.85
~ConsoleDebuggerMethod · 0.85
delete_BM_CBMethod · 0.85
delete_BP_CBMethod · 0.85

Calls 4

nextMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected