mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for bug 65112: Debug Registers view is empty.
This commit is contained in:
parent
bf8c96a8b1
commit
95a0a3e4a4
6 changed files with 108 additions and 93 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2004-06-02 Mikhail Khodjaiants
|
||||||
|
Fix for bug 65112: Debug Registers view is empty.
|
||||||
|
* CRegisterManager.java
|
||||||
|
* CDebugTarget.java
|
||||||
|
* CRegister.java
|
||||||
|
* CRegisterGroup.java
|
||||||
|
* CVariable.java
|
||||||
|
|
||||||
2004-05-28 Mikhail Khodjaiants
|
2004-05-28 Mikhail Khodjaiants
|
||||||
Support for the "Skip All Breakpoints" action.
|
Support for the "Skip All Breakpoints" action.
|
||||||
* CBreakpointManager.java
|
* CBreakpointManager.java
|
||||||
|
|
|
@ -148,4 +148,11 @@ public class CRegisterManager extends CUpdateManager implements ICRegisterManage
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void targetSuspended() {
|
||||||
|
Iterator it = fRegisterGroups.iterator();
|
||||||
|
while( it.hasNext() ) {
|
||||||
|
((CRegisterGroup)it.next()).targetSuspended();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1320,6 +1320,8 @@ public class CDebugTarget extends CDebugElement
|
||||||
ICDISessionObject reason = event.getReason();
|
ICDISessionObject reason = event.getReason();
|
||||||
setCurrentStateInfo( reason );
|
setCurrentStateInfo( reason );
|
||||||
setRunningInfo( null );
|
setRunningInfo( null );
|
||||||
|
// Reset the registers that have errors.
|
||||||
|
getRegisterManager().targetSuspended();
|
||||||
setSuspensionThread();
|
setSuspensionThread();
|
||||||
List newThreads = refreshThreads();
|
List newThreads = refreshThreads();
|
||||||
if ( event.getSource() instanceof ICDITarget )
|
if ( event.getSource() instanceof ICDITarget )
|
||||||
|
@ -1365,7 +1367,6 @@ public class CDebugTarget extends CDebugElement
|
||||||
{
|
{
|
||||||
handleSuspendedBySolibEvent( (ICDISharedLibraryEvent)reason );
|
handleSuspendedBySolibEvent( (ICDISharedLibraryEvent)reason );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
private boolean handleInternalSuspendedEvent( ICDISuspendedEvent event )
|
private boolean handleInternalSuspendedEvent( ICDISuspendedEvent event )
|
||||||
|
|
|
@ -54,11 +54,16 @@ public class CRegister extends CGlobalVariable implements IRegister
|
||||||
*/
|
*/
|
||||||
public boolean hasValueChanged() throws DebugException
|
public boolean hasValueChanged() throws DebugException
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
IValue value = getValue();
|
IValue value = getValue();
|
||||||
if ( value != null )
|
if ( value != null )
|
||||||
{
|
{
|
||||||
return ( value.hasVariables() ) ? false : fChanged;
|
return ( value.hasVariables() ) ? false : fChanged;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch( DebugException e ) {
|
||||||
|
// ignore to prevent logging.
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,127 +1,113 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.core.model;
|
package org.eclipse.cdt.debug.internal.core.model;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
|
import org.eclipse.debug.core.DebugPlugin;
|
||||||
import org.eclipse.debug.core.model.IRegister;
|
import org.eclipse.debug.core.model.IRegister;
|
||||||
import org.eclipse.debug.core.model.IRegisterGroup;
|
import org.eclipse.debug.core.model.IRegisterGroup;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents a group of registers of a debug target.
|
||||||
* Enter type comment.
|
|
||||||
*
|
|
||||||
* @since Sep 16, 2002
|
|
||||||
*/
|
*/
|
||||||
public class CRegisterGroup extends CDebugElement implements IRegisterGroup
|
public class CRegisterGroup extends CDebugElement implements IRegisterGroup {
|
||||||
{
|
|
||||||
private String fName;
|
private String fName;
|
||||||
|
|
||||||
private ICDIRegisterObject[] fRegisterObjects;
|
private ICDIRegisterObject[] fRegisterObjects;
|
||||||
private List fRegisters;
|
|
||||||
|
private IRegister[] fRegisters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for CRegisterGroup.
|
* Constructor for CRegisterGroup.
|
||||||
* @param target
|
|
||||||
*/
|
*/
|
||||||
public CRegisterGroup( CDebugTarget target, String name, ICDIRegisterObject[] regObjects )
|
public CRegisterGroup( CDebugTarget target, String name, ICDIRegisterObject[] regObjects ) {
|
||||||
{
|
|
||||||
super( target );
|
super( target );
|
||||||
fName = name;
|
fName = name;
|
||||||
fRegisterObjects = regObjects;
|
fRegisterObjects = regObjects;
|
||||||
fRegisters = new ArrayList();
|
fRegisters = new IRegister[regObjects.length];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.debug.core.model.IRegisterGroup#getName()
|
* @see org.eclipse.debug.core.model.IRegisterGroup#getName()
|
||||||
*/
|
*/
|
||||||
public String getName() throws DebugException
|
public String getName() throws DebugException {
|
||||||
{
|
|
||||||
return fName;
|
return fName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.debug.core.model.IRegisterGroup#getRegisters()
|
* @see org.eclipse.debug.core.model.IRegisterGroup#getRegisters()
|
||||||
*/
|
*/
|
||||||
public IRegister[] getRegisters() throws DebugException
|
public IRegister[] getRegisters() throws DebugException {
|
||||||
{
|
for ( int i = 0; i < fRegisters.length; ++i ) {
|
||||||
List list = getRegisters0();
|
if ( fRegisters[i] == null ) {
|
||||||
return (IRegister[])list.toArray( new IRegister[list.size()] );
|
fRegisters[i] = new CRegister( this, getCDIRegister( fRegisterObjects[i] ) );
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.debug.core.model.IRegisterGroup#hasRegisters()
|
|
||||||
*/
|
|
||||||
public boolean hasRegisters() throws DebugException
|
|
||||||
{
|
|
||||||
return fRegisterObjects.length > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List getRegisters0() throws DebugException
|
|
||||||
{
|
|
||||||
if ( fRegisters == null || fRegisters.size() == 0 )
|
|
||||||
{
|
|
||||||
ICDIRegister[] regs = getCDIRegisters();
|
|
||||||
fRegisters = new ArrayList( regs.length );
|
|
||||||
for ( int i = 0; i < regs.length; ++i )
|
|
||||||
{
|
|
||||||
fRegisters.add( new CRegister( this, regs[i] ) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fRegisters;
|
return fRegisters;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dispose()
|
/*
|
||||||
{
|
* (non-Javadoc)
|
||||||
Iterator it = fRegisters.iterator();
|
*
|
||||||
while( it.hasNext() )
|
* @see org.eclipse.debug.core.model.IRegisterGroup#hasRegisters()
|
||||||
{
|
*/
|
||||||
((CRegister)it.next()).dispose();
|
public boolean hasRegisters() throws DebugException {
|
||||||
}
|
return fRegisterObjects.length > 0;
|
||||||
fRegisters.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICDIRegister[] getCDIRegisters() throws DebugException
|
public void dispose() {
|
||||||
{
|
for ( int i = 0; i < fRegisters.length; ++i ) {
|
||||||
ICDIRegister[] results = new ICDIRegister[fRegisterObjects.length];
|
if ( fRegisters[i] != null ) {
|
||||||
for ( int i = 0; i < fRegisterObjects.length; ++i )
|
((CRegister)fRegisters[i]).dispose();
|
||||||
{
|
fRegisters[i] = null;
|
||||||
try
|
|
||||||
{
|
|
||||||
results[i] = ((CDebugTarget)getDebugTarget()).getCDISession().getRegisterManager().createRegister( fRegisterObjects[i] );
|
|
||||||
}
|
|
||||||
catch( CDIException e )
|
|
||||||
{
|
|
||||||
results[i] = new CRegister.ErrorRegister( fRegisterObjects[i], e );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return results;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetChangeFlags()
|
private ICDIRegister getCDIRegister( ICDIRegisterObject ro ) throws DebugException {
|
||||||
{
|
try {
|
||||||
if ( fRegisters == null )
|
return ((CDebugTarget)getDebugTarget()).getCDISession().getRegisterManager().createRegister( ro );
|
||||||
return;
|
}
|
||||||
try
|
catch( CDIException e ) {
|
||||||
{
|
return new CRegister.ErrorRegister( ro, e );
|
||||||
Iterator it = fRegisters.iterator();
|
|
||||||
while( it.hasNext() )
|
|
||||||
{
|
|
||||||
((CVariable)it.next()).setChanged( false );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch( DebugException e )
|
|
||||||
{
|
public void resetChangeFlags() {
|
||||||
CDebugCorePlugin.log( e );
|
for ( int i = 0; i < fRegisters.length; ++i ) {
|
||||||
|
if ( fRegisters[i] != null ) {
|
||||||
|
try {
|
||||||
|
((CRegister)fRegisters[i]).setChanged( false );
|
||||||
|
}
|
||||||
|
catch( DebugException e ) {
|
||||||
|
DebugPlugin.log( e );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void targetSuspended() {
|
||||||
|
for ( int i = 0; i < fRegisters.length; ++i ) {
|
||||||
|
if ( fRegisters[i] != null && ((CRegister)fRegisters[i]).hasErrors() ) {
|
||||||
|
((CRegister)fRegisters[i]).dispose();
|
||||||
|
fRegisters[i] = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -307,6 +307,10 @@ public abstract class CVariable extends CDebugElement
|
||||||
}
|
}
|
||||||
return fQualifiedName;
|
return fQualifiedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasErrors() {
|
||||||
|
return ( fCDIVariable instanceof ErrorVariable );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1043,4 +1047,8 @@ public abstract class CVariable extends CDebugElement
|
||||||
{
|
{
|
||||||
return getInternalVariable().sizeof();
|
return getInternalVariable().sizeof();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasErrors() {
|
||||||
|
return ( getShadow() != null ) ? getShadow().hasErrors() : fOriginal.hasErrors();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue