Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 248606 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/cdt/debug/internal/core/CRequest.java (+11 lines)
Lines 1-3 Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 Wind River Systems, Inc. and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Anton Leherbauer (Wind River Systems) - initial API and implementation
10
 *     Freescale Semiconductor - refactoring
11
 *******************************************************************************/
1
package org.eclipse.cdt.debug.internal.core;
12
package org.eclipse.cdt.debug.internal.core;
2
13
3
import org.eclipse.core.runtime.IStatus;
14
import org.eclipse.core.runtime.IStatus;
(-)src/org/eclipse/cdt/debug/internal/core/ICWatchpointTarget.java (-1 / +1 lines)
Lines 25-31 Link Here
25
25
26
	/** IRequest object used in the asynchronous method {@link ICWatchpointTarget#getSize()} */
26
	/** IRequest object used in the asynchronous method {@link ICWatchpointTarget#getSize()} */
27
	interface GetSizeRequest extends IRequest {
27
	interface GetSizeRequest extends IRequest {
28
		int getSize();
28
		int getSize(); // returns -1 if size not available
29
		void setSize(int size);
29
		void setSize(int size);
30
	};
30
	};
31
	
31
	
(-)src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointOnVariableActionDelegate.java (-1 / +2 lines)
Lines 53-59 Link Here
53
	}
53
	}
54
54
55
	private static class GetSizeRequest extends CRequest implements ICWatchpointTarget.GetSizeRequest {
55
	private static class GetSizeRequest extends CRequest implements ICWatchpointTarget.GetSizeRequest {
56
		int fSize;
56
		int fSize = -1;
57
		public int getSize() {
57
		public int getSize() {
58
			return fSize;
58
			return fSize;
59
		}
59
		}
Lines 122-127 Link Here
122
	 *      org.eclipse.jface.viewers.ISelection)
122
	 *      org.eclipse.jface.viewers.ISelection)
123
	 */
123
	 */
124
	public void selectionChanged(final IAction action, ISelection selection) {
124
	public void selectionChanged(final IAction action, ISelection selection) {
125
		fVar = null;
125
		if (selection == null || selection.isEmpty()) {
126
		if (selection == null || selection.isEmpty()) {
126
			action.setEnabled(false);
127
			action.setEnabled(false);
127
			return;
128
			return;
(-)src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/GdbVariableVMNode.java (-8 / +10 lines)
Lines 66-84 Link Here
66
	                    if (expressionService != null) {
66
	                    if (expressionService != null) {
67
	                    	final DataRequestMonitor<IExpressionDMAddress> drm = new DataRequestMonitor<IExpressionDMAddress>(getSession().getExecutor(), null) {
67
	                    	final DataRequestMonitor<IExpressionDMAddress> drm = new DataRequestMonitor<IExpressionDMAddress>(getSession().getExecutor(), null) {
68
                                @Override
68
                                @Override
69
								public void handleSuccess() {
69
								public void handleCompleted() {
70
                                    request.setSize(getData().getSize());
70
                                	if (isSuccess()) {
71
                                		request.setSize(getData().getSize());
72
                                	}
71
                                    request.done();
73
                                    request.done();
72
                                }
74
                                }
73
	                    	};
75
	                    	};
74
	                    	
76
	                    	
75
	                        expressionService.getExpressionAddressData(exprDmc, drm);
77
	                        expressionService.getExpressionAddressData(exprDmc, drm);
76
	                    }
78
	                    }
79
	        			else {
80
	        				request.done();
81
	        			}
77
	                }
82
	                }
78
	            });
83
	            });
79
			}
84
			}
80
			else {
85
			else {
81
				request.setSize(-1);
82
				request.done();
86
				request.done();
83
			}
87
			}
84
		}
88
		}
Lines 104-127 Link Here
104
	                                	assert getData().getSize() > 0;
108
	                                	assert getData().getSize() > 0;
105
	                                    request.setCanCreate(true);
109
	                                    request.setCanCreate(true);
106
                                	}
110
                                	}
107
                                	else {
108
                                		request.setCanCreate(false);
109
                                	}
110
	                                request.done();
111
	                                request.done();
111
                                }
112
                                }
112
	                    	};
113
	                    	};
113
	                    	
114
	                    	
114
	                        expressionService.getExpressionAddressData(exprDmc, drm);
115
	                        expressionService.getExpressionAddressData(exprDmc, drm);
115
	                    }
116
	                    }
117
	        			else {
118
	        				request.done();
119
	        			}
116
	                }
120
	                }
117
	            });
121
	            });
118
			}
122
			}
119
			else {
123
			else {
120
				request.setCanCreate(false);
121
				request.done();
124
				request.done();
122
			}
125
			}
123
		}
126
		}
124
		
125
	};
127
	};
126
	
128
	
127
	/**
129
	/**

Return to bug 248606