1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 09:16:02 +02:00

Bug 250638 - NPEs when disassembling in debugger

Patch by Øyvind Harboe
This commit is contained in:
Anton Leherbauer 2008-10-17 08:38:54 +00:00
parent f91408d15a
commit 868e29ac4f
2 changed files with 10 additions and 3 deletions

View file

@ -10,6 +10,7 @@
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
* Andrew Ferguson (Symbian) * Andrew Ferguson (Symbian)
* Anton Leherbauer (Wind River Systems) * Anton Leherbauer (Wind River Systems)
* oyvind.harboe@zylin.com - http://bugs.eclipse.org/250638
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core; package org.eclipse.cdt.core;
@ -566,6 +567,8 @@ public class CCorePlugin extends Plugin {
if (project != null) { if (project != null) {
try { try {
ICDescriptor cdesc = getCProjectDescription(project, false); ICDescriptor cdesc = getCProjectDescription(project, false);
if (cdesc==null)
return ext;
ICExtensionReference[] cextensions = cdesc.get(BINARY_PARSER_UNIQ_ID, true); ICExtensionReference[] cextensions = cdesc.get(BINARY_PARSER_UNIQ_ID, true);
if (cextensions != null && cextensions.length > 0) if (cextensions != null && cextensions.length > 0)
ext = cextensions; ext = cextensions;

View file

@ -1,12 +1,13 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2006 QNX Software Systems and others. * Copyright (c) 2004, 2008 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
* oyvind.harboe@zylin.com - http://bugs.eclipse.org/250638
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.debug.internal.core.model; package org.eclipse.cdt.debug.internal.core.model;
@ -66,6 +67,8 @@ public class Disassembly extends CDebugElement implements IDisassembly, ICDIEven
int lineNumber = frame.getLineNumber(); int lineNumber = frame.getLineNumber();
ICDIMixedInstruction[] mixedInstrs = new ICDIMixedInstruction[0]; ICDIMixedInstruction[] mixedInstrs = new ICDIMixedInstruction[0];
IAddress address = frame.getAddress(); IAddress address = frame.getAddress();
if (address==null)
return null;
if ( fileName != null && fileName.length() > 0 ) { if ( fileName != null && fileName.length() > 0 ) {
try { try {
mixedInstrs = target.getMixedInstructions( fileName, mixedInstrs = target.getMixedInstructions( fileName,
@ -133,6 +136,7 @@ public class Disassembly extends CDebugElement implements IDisassembly, ICDIEven
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/ */
@Override
public Object getAdapter( Class adapter ) { public Object getAdapter( Class adapter ) {
if ( IExecFileInfo.class.equals( adapter ) ) if ( IExecFileInfo.class.equals( adapter ) )
return getDebugTarget().getAdapter( adapter ); return getDebugTarget().getAdapter( adapter );