static void GetDlgStatus( gui_window *gui ) { long tab; unsigned old; old = NewCurrRadix( 10 ); _SwitchSet( SW_ASM_SOURCE, GUIIsChecked( gui, CTL_WIND_ASM_SOURCE ) ); _SwitchSet( SW_ASM_HEX, GUIIsChecked( gui, CTL_WIND_ASM_HEX ) ); _SwitchSet( SW_VAR_WHOLE_EXPR, GUIIsChecked( gui, CTL_WIND_VAR_EXPR ) ); _SwitchSet( SW_VAR_SHOW_CODE, GUIIsChecked( gui, CTL_WIND_VAR_CODE ) ); _SwitchSet( SW_VAR_SHOW_INHERIT, GUIIsChecked( gui, CTL_WIND_VAR_INHERIT ) ); _SwitchSet( SW_VAR_SHOW_COMPILER, GUIIsChecked( gui, CTL_WIND_VAR_COMPILER ) ); _SwitchSet( SW_VAR_SHOW_MEMBERS, GUIIsChecked( gui, CTL_WIND_VAR_MEMBERS ) ); _SwitchSet( SW_VAR_SHOW_PRIVATE, GUIIsChecked( gui, CTL_WIND_VAR_PRIVATE ) ); _SwitchSet( SW_VAR_SHOW_PROTECTED, GUIIsChecked( gui, CTL_WIND_VAR_PROTECTED ) ); _SwitchSet( SW_VAR_SHOW_STATIC, GUIIsChecked( gui, CTL_WIND_VAR_STATIC ) ); _SwitchSet( SW_FUNC_D2_ONLY, GUIIsChecked( gui, CTL_WIND_FUNC_TYPED ) ); _SwitchSet( SW_GLOB_D2_ONLY, GUIIsChecked( gui, CTL_WIND_GLOB_TYPED ) ); _SwitchSet( SW_MOD_ALL_MODULES, GUIIsChecked( gui, CTL_WIND_MOD_ALL ) ); if( DlgGetLong( gui, CTL_WIND_FILE_TAB, &tab ) ) { TabIntervalSet( tab ); } AsmChangeOptions(); VarChangeOptions(); FuncChangeOptions(); GlobChangeOptions(); ModChangeOptions(); NewCurrRadix( old ); }
static void GetDlgStatus( gui_window *gui ) { long tmp; unsigned old; old = NewCurrRadix( 10 ); _SwitchSet( SW_AUTO_SAVE_CONFIG, GUIIsChecked( gui, CTL_OPT_AUTO ) ); _SwitchSet( SW_BELL, GUIIsChecked( gui, CTL_OPT_BELL ) ); _SwitchSet( SW_IMPLICIT, GUIIsChecked( gui, CTL_OPT_IMPLICIT ) ); _SwitchSet( SW_RECURSE_CHECK, GUIIsChecked( gui, CTL_OPT_RECURSE ) ); _SwitchSet( SW_FLIP, GUIIsChecked( gui, CTL_OPT_FLIP ) ); _SwitchSet( SW_DONT_EXPAND_HEX, GUIIsChecked( gui, CTL_OPT_NOHEX ) ); LookCaseSet( !GUIIsChecked( gui, CTL_OPT_CASE ) ); if( DlgGetLong( gui, CTL_OPT_RADIX, &tmp ) ) { DefaultRadixSet( tmp ); old = NewCurrRadix( 10 ); } if( DlgGetLong( gui, CTL_OPT_DCLICK, &tmp ) ) { WndSetDClick( tmp ); } NewCurrRadix( old ); /* Don't change config if it is just the trap file that does not support the option! */ if( SupportsExactBreakpoints ) { _SwitchSet( SW_BREAK_ON_WRITE, GUIIsChecked( gui, CTL_OPT_BR_ON_WRITE ) ); CapabilitiesSetExactBreakpointSupport( _IsOn( SW_BREAK_ON_WRITE ) ? TRUE : FALSE ); } }
static brkp *PointBreak( memory_expr def_seg, address *addr ) { unsigned index; brkp *bp; unsigned old; if( addr != NULL ) { *addr = NilAddr; } if( CurrToken == T_SHARP ) { Scan(); old = NewCurrRadix( 10 ); index = ReqExpr(); // always decimal NewCurrRadix( old ); for( bp = BrkList; bp != NULL; bp = bp->next ) { if( bp->index == index ) { break; } } } else { ReqMemAddr( def_seg, addr ); for( bp = BrkList; bp != NULL; bp = bp->next ) { if( AddrComp( bp->loc.addr, *addr ) == 0 ) { break; } } } ReqEOC(); if( bp != NULL && addr != NULL ) { *addr = bp->loc.addr; } return( bp ); }
static char *DoMadLongConv( char *buff, size_t buff_len, unsigned long value, mad_radix radix, int size ) { mad_radix old_radix; mad_type_info mti; old_radix = NewCurrRadix( radix ); MADTypeInfoForHost( MTK_INTEGER, size, &mti ); MADTypeToString( radix, &mti, &value, buff, &buff_len ); NewCurrRadix( old_radix ); return( buff + buff_len ); }
static void RegModify( a_window *wnd, int row, int piece ) { int i; item_mach value; reg_window *reg = WndReg( wnd ); bool ok; mad_radix old_radix; reg_display_piece disp; mad_type_info tinfo; mad_modify_list const *possible; int num_possible; if( row < 0 ) return; piece >>= 1; i = GetRegIdx( reg, row, piece ); if( i == -1 ) return; if( !GetDisplayPiece( &disp, reg, DbgRegs, i ) ) return; if( disp.reginfo == NULL ) return; if( MADRegSetDisplayModify( reg->data, disp.reginfo, &possible, &num_possible ) != MS_OK ) return; old_radix = NewCurrRadix( MADTypePreferredRadix( disp.disp_type ) ); MADRegFullName( disp.reginfo, ".", TxtBuff, TXT_LEN ); RegValue( &value, disp.reginfo, DbgRegs ); if( num_possible == 1 ) { ok = DlgMadTypeExpr( TxtBuff, &value, disp.disp_type ); if( ok ) { RegNewValue( disp.reginfo, &value, possible->type ); } } else { for( i = 0; i < num_possible; ++i ) { MADTypeInfo( possible[i].type, &tinfo ); if( memcmp( &value, possible[i].data, tinfo.b.bits / BITS_PER_BYTE ) == 0 ) { break; } } if( num_possible == 2 ) { if( i == 0 ) { i = 1; } else { i = 0; } } else { //MJC const cast i = DlgPickWithRtn( TxtBuff, possible, i, RegValueName, num_possible ); } if( i != -1 ) { RegNewValue( disp.reginfo, possible[i].data, possible[i].type ); } } NewCurrRadix( old_radix ); }
static void CalcAddrLen( a_window *wnd, address addr ) { asm_window *asw = WndAsm( wnd ); unsigned old; old = NewCurrRadix( asw->hex ? 16 : 10 ); AddrToString( &addr, MAF_OFFSET, TxtBuff, TXT_LEN ); asw->address_end = MaxGadgetLength; asw->address_end += ( strlen( TxtBuff ) + 1 ) * WndMidCharX( wnd ); NewCurrRadix( old ); }
static bool RegGetLine( a_window *wnd, int row, int piece, wnd_line_piece *line ) { int column; int i; reg_window *reg = WndReg( wnd ); size_t max = TXT_LEN; mad_radix old_radix, new_radix; item_mach value; reg_display_piece disp; column = piece >> 1; if( column >= reg->up ) return( false ); i = GetRegIdx( reg, row, column ); if( i >= reg->count ) return( false ); if( i == -1 ) return( false ); if( !GetDisplayPiece( &disp, reg, DbgRegs, i ) ) return( false ); line->text = TxtBuff; if( piece & 1 ) { line->indent = reg->indents[column].value; if( reg->info[i].info == NULL ) { strcpy( TxtBuff, " " ); } else { new_radix = MADTypePreferredRadix( disp.disp_type ); old_radix = NewCurrRadix( new_radix ); RegValue( &value, reg->info[i].info, DbgRegs ); max = reg->info[i].max_value + 1; MADTypeHandleToString( new_radix, disp.disp_type, &value, TxtBuff, &max ); NewCurrRadix( old_radix ); reg->info[i].standout = false; if( MADRegModified( reg->data, reg->info[i].info, &PrevRegs->mr, &DbgRegs->mr ) == MS_MODIFIED_SIGNIFICANTLY ) { reg->info[i].standout = true; line->attr = WND_STANDOUT; } } } else { line->indent = reg->indents[column].descript; strcpy( TxtBuff, disp.descript ); if( TxtBuff[0] != NULLCHAR ) { strcat( TxtBuff, ":" ); } line->tabstop = false; } return( true ); }
unsigned SetCurrRadix( unsigned rad ) { unsigned old; old = NewCurrRadix( rad ); ReScan( TokenStart ); return( old ); }
OVL_EXTERN bool IOGetLine( a_window wnd, wnd_row row, wnd_piece piece, wnd_line_piece *line ) { io_window *io = WndIO( wnd ); // bool ret; io_location *curr; int i; mad_radix old_radix, new_radix; size_t max; if( row >= io->num_rows ) return( false ); curr = &io->list[row]; // ret = true; line->text = TxtBuff; switch( piece ) { case PIECE_READ: SetGadgetLine( wnd, line, GADGET_READ ); return( true ); case PIECE_WRITE: SetGadgetLine( wnd, line, GADGET_WRITE ); line->indent = MaxGadgetLength; return( true ); case PIECE_ADDRESS: AddrToIOString( &curr->addr, TxtBuff, TXT_LEN ); line->indent = 2 * MaxGadgetLength; return( true ); case PIECE_VALUE: new_radix = IOData.info[curr->type].piece_radix; old_radix = NewCurrRadix( new_radix ); line->indent = 2 * MaxGadgetLength + 10 * WndMaxCharX( wnd ); if( curr->value_known ) { max = TXT_LEN; MADTypeHandleToString( new_radix, IOData.info[curr->type].mth, &curr->value, TxtBuff, &max ); } else { for( i = 0; i < IOData.info[curr->type].item_width; ++i ) { TxtBuff[i] = '?'; } TxtBuff[i] = NULLCHAR; } NewCurrRadix( old_radix ); return( true ); default: return( false ); } }
static void SetDlgStatus( gui_window *gui ) { unsigned old; old = NewCurrRadix( 10 ); GUISetChecked( gui, CTL_WIND_ASM_SOURCE, _IsOn( SW_ASM_SOURCE ) ); GUISetChecked( gui, CTL_WIND_ASM_HEX, _IsOn( SW_ASM_HEX ) ); GUISetChecked( gui, CTL_WIND_VAR_EXPR, _IsOn( SW_VAR_WHOLE_EXPR ) ); GUISetChecked( gui, CTL_WIND_VAR_CODE, _IsOn( SW_VAR_SHOW_CODE ) ); GUISetChecked( gui, CTL_WIND_VAR_INHERIT, _IsOn( SW_VAR_SHOW_INHERIT ) ); GUISetChecked( gui, CTL_WIND_VAR_COMPILER, _IsOn( SW_VAR_SHOW_COMPILER ) ); GUISetChecked( gui, CTL_WIND_VAR_MEMBERS, _IsOn( SW_VAR_SHOW_MEMBERS ) ); GUISetChecked( gui, CTL_WIND_VAR_PRIVATE, _IsOn( SW_VAR_SHOW_PRIVATE ) ); GUISetChecked( gui, CTL_WIND_VAR_PROTECTED, _IsOn( SW_VAR_SHOW_PROTECTED ) ); GUISetChecked( gui, CTL_WIND_VAR_STATIC, _IsOn( SW_VAR_SHOW_STATIC ) ); GUISetChecked( gui, CTL_WIND_FUNC_TYPED, _IsOn( SW_FUNC_D2_ONLY ) ); GUISetChecked( gui, CTL_WIND_GLOB_TYPED, _IsOn( SW_GLOB_D2_ONLY ) ); GUISetChecked( gui, CTL_WIND_MOD_ALL, _IsOn( SW_MOD_ALL_MODULES ) ); DlgSetLong( gui, CTL_WIND_FILE_TAB, TabIntervalGet() ); NewCurrRadix( old ); }
static void SetDlgStatus( gui_window *gui ) { unsigned old; old = NewCurrRadix( 10 ); GUISetChecked( gui, CTL_OPT_AUTO, _IsOn( SW_AUTO_SAVE_CONFIG ) ); GUISetChecked( gui, CTL_OPT_BELL, _IsOn( SW_BELL ) ); GUISetChecked( gui, CTL_OPT_IMPLICIT, _IsOn( SW_IMPLICIT ) ); GUISetChecked( gui, CTL_OPT_RECURSE, _IsOn( SW_RECURSE_CHECK ) ); GUISetChecked( gui, CTL_OPT_FLIP, _IsOn( SW_FLIP ) ); GUISetChecked( gui, CTL_OPT_CASE, _IsOn( SW_CASE_IGNORE ) ); DlgSetLong( gui, CTL_OPT_RADIX, old ); DlgSetLong( gui, CTL_OPT_DCLICK, WndGetDClick() ); NewCurrRadix( old ); GUIEnableControl( gui, CTL_OPT_BR_ON_WRITE, SupportsExactBreakpoints ); GUISetChecked( gui, CTL_OPT_NOHEX, _IsOn( SW_DONT_EXPAND_HEX ) ); if( SupportsExactBreakpoints ) GUISetChecked( gui, CTL_OPT_BR_ON_WRITE, _IsOn ( SW_BREAK_ON_WRITE ) ); else GUISetChecked( gui, CTL_OPT_BR_ON_WRITE, FALSE ); }
static void GotoLine( a_window *wnd ) { long line; mad_radix old_radix; wnd_row curr_row; int curr_piece; old_radix = NewCurrRadix( 10 ); WndGetCurrent( wnd, &curr_row, &curr_piece ); if( curr_row < 0 || curr_row == WND_NO_ROW ) { line = WndTop( wnd ); } else { line = curr_row; } ++line; if( DlgLongExpr( LIT_DUI( New_Line ), &line ) ) { --line; WndDirtyCurr( wnd ); Centre( wnd, line ); WndNewCurrent( wnd, line, PIECE_SOURCE ); } NewCurrRadix( old_radix ); }
static void GotoLine( a_window *wnd ) { long line; unsigned old; wnd_row row; int piece; old = NewCurrRadix( 10 ); WndGetCurrent( wnd, &row, &piece ); if( row < 0 || row == WND_NO_ROW ) { line = WndTop( wnd ); } else { line = row; } ++line; if( DlgLongExpr( LIT( New_Line ), &line ) ) { --line; WndDirtyCurr( wnd ); Centre( wnd, line ); WndNewCurrent( wnd, line, PIECE_SOURCE ); } NewCurrRadix( old ); }
void ProcDisplay( void ) { wnd_class_wv wndclass; mad_radix old_radix; if( ScanEOC() ) { while( HookPendingPush() ); PushRefresh(); return; } old_radix = NewCurrRadix( 10 ); switch( ScanCmd( MiscTab ) ) { case MISC_TOOL: ProcTool(); break; case MISC_STATUS: ProcStatus(); break; default: wndclass = ReqWndName(); ProcSize( wndclass ); } NewCurrRadix( old_radix ); }
OVL_EXTERN void IOMenuItem( a_window wnd, gui_ctl_id id, wnd_row row, wnd_piece piece ) { io_window *io = WndIO( wnd ); address addr; bool ok; item_mach item; io_location *curr; mad_radix old_radix; /* unused parameters */ (void)piece; if( row < io->num_rows && row >= 0 ) { curr = &io->list[row]; } else { curr = NULL; } switch( id ) { case MENU_INITIALIZE: if( curr == NULL ) { WndMenuGrayAll( wnd ); } else { WndMenuEnableAll( wnd ); } WndMenuEnable( wnd, MENU_IO_NEW_ADDRESS, true ); break; case MENU_IO_DELETE: io->num_rows--; memcpy( &io->list[row], &io->list[row + 1], ( io->num_rows - row ) * sizeof( io_location ) ); WndNoSelect( wnd ); WndSetRepaint( wnd ); break; case MENU_IO_NEW_ADDRESS: addr = NilAddr; if( !DlgGivenAddr( LIT_DUI( New_Port_Addr ), &addr ) ) return; WndRowDirty( wnd, io->num_rows ); IOAddNewAddr( wnd, &addr, MENU_IO_FIRST_TYPE ); WndScrollBottom( wnd ); break; case MENU_IO_MODIFY: if( row >= io->num_rows || row < 0 ) break; if( piece == PIECE_VALUE ) { old_radix = NewCurrRadix( IOData.info[curr->type].piece_radix ); item.ud = curr->value_known ? curr->value.ud : 0; ok = DlgMadTypeExpr( TxtBuff, &item, IOData.info[curr->type].mth ); if( ok ) { curr->value = item; curr->value_known = true; } NewCurrRadix( old_radix ); } else { addr = curr->addr; if( !DlgGivenAddr( LIT_DUI( New_Port_Addr ), &addr ) ) return; curr->addr = addr; curr->value_known = false; } WndRowDirty( wnd, row ); break; case MENU_IO_READ: curr->value_known = true; if( ItemGetMAD( &curr->addr, &curr->value, IT_IO, IOData.info[curr->type].mth ) == IT_NIL ) { curr->value_known = false; } WndPieceDirty( wnd, row, PIECE_VALUE ); break; case MENU_IO_WRITE: if( curr->value_known ) { ItemPutMAD( &curr->addr, &curr->value, IT_IO, IOData.info[curr->type].mth ); } break; default: curr->type = PIECE_TYPE( id ); WndZapped( wnd ); break; } }
bool SetMsgText( char *message, unsigned *conditions ) /****************************************************/ { char *equal,*comma1,*comma2; address addr,buff_addr; long buff_len,sym_len; long num_returns; cmd_list *cmds; if( memcmp( message, DEBUGGER_THREADID_COMMAND, sizeof( DEBUGGER_THREADID_COMMAND ) - 1 ) == 0 ) { message += sizeof( DEBUGGER_THREADID_COMMAND ) - 1; equal = strchr( message, '=' ); if( equal == NULL ) return( TRUE ); *equal = '\0'; CheckForNewThreads( FALSE ); NoCRLF( equal + 1 ); NameThread( strtoul( message, NULL, 16 ), equal + 1 ); return( FALSE ); } else if( memcmp( message, DEBUGGER_SETTRUE_COMMAND, sizeof( DEBUGGER_SETTRUE_COMMAND ) - 1 ) == 0 ) { unsigned old = NewCurrRadix( 16 ); NoCRLF( message ); if( DlgScanDataAddr( message + sizeof( DEBUGGER_SETTRUE_COMMAND ) - 1, &addr ) ) { ProgPoke( addr, "\x1", 1 ); } NewCurrRadix( old ); return( FALSE ); } else if( memcmp( message, DEBUGGER_EXECUTE_COMMAND, sizeof( DEBUGGER_EXECUTE_COMMAND ) - 1 ) == 0 ) { message += sizeof( DEBUGGER_EXECUTE_COMMAND ) - 1; NoCRLF( message ); if( InCall == 0 ) { cmds = AllocCmdList( "go/keep", strlen( "go/keep" ) ); PushCmdList( cmds ); TypeInpStack( INP_HOOK ); FreeCmdList( cmds ); } cmds = AllocCmdList( message, strlen( message ) ); PushCmdList( cmds ); TypeInpStack( INP_HOOK ); FreeCmdList( cmds ); *conditions |= COND_STOP; return( FALSE ); } else if( memcmp( message, DEBUGGER_MESSAGE_COMMAND, sizeof( DEBUGGER_MESSAGE_COMMAND ) - 1 ) == 0 ) { message += sizeof( DEBUGGER_MESSAGE_COMMAND ) - 1; NoCRLF( message ); AddMessageText( message ); return( FALSE ); } else if( memcmp( message, DEBUGGER_LOOKUP_COMMAND, sizeof( DEBUGGER_LOOKUP_COMMAND ) - 1 ) == 0 ) { message += sizeof( DEBUGGER_LOOKUP_COMMAND ) - 1; comma1 = strchr( message, ',' ); if( comma1 == NULL ) return( TRUE ); *comma1++ = '\0'; comma2 = strchr( comma1, ',' ); if( comma2 == NULL ) return( TRUE ); *comma2++ = '\0'; NoCRLF( comma2 ); if( !DlgScanDataAddr( message, &addr ) ) return( TRUE ); if( !DlgScanDataAddr( comma1, &buff_addr ) ) return( TRUE ); if( !DlgScanLong( comma2, &buff_len ) ) return( TRUE ); CnvNearestAddr( addr, TxtBuff, TXT_LEN ); sym_len = strlen( TxtBuff ) + 1; if( sym_len > buff_len ) { TxtBuff[buff_len - 1] = '\0'; sym_len = buff_len; } ProgPoke( buff_addr, TxtBuff, sym_len ); return( FALSE ); } else if( memcmp( message, DEBUGGER_LOADMODULE_COMMAND, sizeof( DEBUGGER_LOADMODULE_COMMAND ) - 1 ) == 0 ) { message += sizeof( DEBUGGER_LOADMODULE_COMMAND ) - 1; comma1 = strchr( message, ',' ); if( comma1 == NULL ) return( TRUE ); *comma1++ = '\0'; NoCRLF( comma1 ); if( !DlgScanDataAddr( message, &addr ) ) return( TRUE ); SymUserModLoad( comma1, &addr ); return( FALSE ); } else if( memcmp( message, DEBUGGER_UNLOADMODULE_COMMAND, sizeof( DEBUGGER_UNLOADMODULE_COMMAND ) - 1 ) == 0 ) { message += sizeof( DEBUGGER_UNLOADMODULE_COMMAND ) - 1; NoCRLF( message ); SymUserModUnload( message ); return( FALSE ); } else if( memcmp( message, DEBUGGER_BREAKRETURN_COMMAND, sizeof( DEBUGGER_BREAKRETURN_COMMAND ) - 1 ) == 0 ) { message += sizeof( DEBUGGER_BREAKRETURN_COMMAND ) - 1; NoCRLF( message ); if( !DlgScanLong( message, &num_returns ) ) return( TRUE ); // TODO: do something with num_returns value return( FALSE ); } else { AddMessageText( message ); return( TRUE ); } }
static void VarModify( a_window *wnd, int row, int piece ) { var_node *v; type_kind class; var_window *var = WndVar( wnd ); bool ok; bool followable; unsigned old; if( row < 0 ) { if( var->vtype == VAR_WATCH || var->vtype == VAR_VARIABLE ) { VarMenuItem( wnd, MENU_VAR_NEW_EXPRESSION, row, piece ); } return; } VarErrState(); VarKillExprSPCache( &var->i ); v = VarFindRow( &var->i, row ); if( v == NULL ) { v = VarFindRowNode( &var->i, row ); if( v == NULL ) return; if( piece != VAR_PIECE_GADGET && piece != VAR_PIECE_NAME ) return; if( v->expand != NULL || v->node_type == NODE_INHERIT ) { VarExpandRow( &var->i, v, row ); WndNewCurrent( wnd, row, VAR_PIECE_NAME ); VarRepaint( wnd ); } return; } followable = VarGetStackClass( &class ); switch( piece ) { case VAR_PIECE_GADGET: case VAR_PIECE_NAME: if( VarExpandable( class ) || followable || v->expand != NULL ) { VarExpandRow( &var->i, v, row ); WndNewCurrent( wnd, row, VAR_PIECE_NAME ); VarRepaint( wnd ); } break; case VAR_PIECE_VALUE: if( !VarExpandable( class ) ) { char *value = DbgAlloc( TXT_LEN ); char *name = DbgAlloc( TXT_LEN ); old = VarNewCurrRadix( v ); ExprValue( ExprSP ); VarBuildName( &var->i, v, FALSE ); StrCopy( TxtBuff, name ); VarPrintText( &var->i, value, PrintValue, TXT_LEN ); VarKillExprSPCache( &var->i ); v = VarFindRow( &var->i, row ); FreezeStack(); ok = DlgAnyExpr( name, value, TXT_LEN ); UnFreezeStack( FALSE ); if( ok ) VarDoAssign( &var->i, v, value ); NewCurrRadix( old ); WndRowDirty( wnd, row ); DbgFree( value ); DbgFree( name ); } break; } VarDoneRow( &var->i ); VarOldErrState(); }
static brkp *SetPoint( memory_expr def_seg, mad_type_handle th ) { brkp *bp; const char *start; size_t len; address loc; cmd_list *cmds; char *condition; long countdown; bool resume; bool active; int index; mad_type_info mti; unsigned old; bool unmapped; bool mapaddress; bool symaddress; char *image_name; char *mod_name; char *sym_name; long cue_diff; long addr_diff; int cmd; resume = false; index = 0; active = true; unmapped = false; mapaddress = false; symaddress = false; while( CurrToken == T_DIV ) { Scan(); cmd = ScanCmd( PointNameTab ); if( cmd < 0 ) break; switch( cmd ) { case B_RESUME: resume = true; break; case B_UNRESUME: resume = false; break; case B_ACTIVATE: active = true; break; case B_DEACTIVATE: active = false; break; case B_UNMAPPED: unmapped = true; break; case B_MAPADDRESS: mapaddress = true; ScanItem( true, &start, &len ); image_name = DupStrLen( start, len ); loc.mach.segment = ReqLongExpr(); loc.mach.offset = ReqLongExpr(); ReqComma(); break; case B_SYMADDRESS: symaddress = true; ScanItem( true, &start, &len ); image_name = DupStrLen( start, len ); ScanItem( true, &start, &len ); mod_name = DupStrLen( start, len ); ScanItem( true, &start, &len ); sym_name = DupStrLen( start, len ); cue_diff = ReqLongExpr(); addr_diff = ReqLongExpr(); loc = NilAddr; ReqComma(); break; case B_INDEX: old = NewCurrRadix( 10 ); index = ReqExpr(); NewCurrRadix( old ); ReqComma(); break; /* fall thru */ default: Error( ERR_LOC, LIT_ENG( ERR_BAD_OPTION ), GetCmdName( CMD_BREAK ) ); break; } } if( !unmapped ) { ReqMemAddr( def_seg, &loc ); } for( bp = BrkList; bp != NULL; bp = bp->next ) { if( AddrComp( bp->loc.addr, loc ) == 0 ) { Error( ERR_NONE, LIT_ENG( ERR_POINT_EXISTS ) ); } } cmds = NULL; condition = NULL; countdown = 0; if( ScanQuote( &start, &len ) ) { if( len != 0 ) cmds = AllocCmdList( start, len ); if( ScanQuote( &start, &len ) ) { if( len != 0 ) condition = DupStrLen( start, len ); if( !ScanEOC() ) { countdown = ReqExpr(); } } } ReqEOC(); if( !IS_BP_EXECUTE( th ) ) { MADTypeInfo( th, &mti ); switch( mti.b.bits / BITS_PER_BYTE ) { case 1: case 2: case 4: break; case 8: if( Is8ByteBreakpointsSupported() ) break; default: Error( ERR_NONE, LIT_ENG( ERR_NOT_WATCH_SIZE ) ); break; } } bp = AddPoint( loc, th, unmapped ); if( bp == NULL ) return( NULL ); bp->status.b.unmapped = unmapped; if( mapaddress ) { bp->loc.image_name = image_name; } if( symaddress ) { bp->image_name = image_name; bp->mod_name = mod_name; bp->sym_name = sym_name; bp->cue_diff = cue_diff; bp->addr_diff = addr_diff; } bp->cmds = cmds; if( cmds != NULL ) bp->status.b.use_cmds = true; bp->condition = condition; if( condition != NULL ) bp->status.b.use_condition = true; SetBPCountDown( bp, countdown ); bp->status.b.resume = resume; bp->status.b.active = active; if( index != 0 ) bp->index = index; RecordBreakEvent( bp, B_SET ); return( bp ); }