1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +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)
* Andrew Ferguson (Symbian)
* Anton Leherbauer (Wind River Systems)
* oyvind.harboe@zylin.com - http://bugs.eclipse.org/250638
*******************************************************************************/
package org.eclipse.cdt.core;
@ -566,6 +567,8 @@ public class CCorePlugin extends Plugin {
if (project != null) {
try {
ICDescriptor cdesc = getCProjectDescription(project, false);
if (cdesc==null)
return ext;
ICExtensionReference[] cextensions = cdesc.get(BINARY_PARSER_UNIQ_ID, true);
if (cextensions != null && cextensions.length > 0)
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
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* 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;
@ -65,7 +66,9 @@ public class Disassembly extends CDebugElement implements IDisassembly, ICDIEven
String fileName = frame.getFile();
int lineNumber = frame.getLineNumber();
ICDIMixedInstruction[] mixedInstrs = new ICDIMixedInstruction[0];
IAddress address = frame.getAddress();
IAddress address = frame.getAddress();
if (address==null)
return null;
if ( fileName != null && fileName.length() > 0 ) {
try {
mixedInstrs = target.getMixedInstructions( fileName,
@ -133,6 +136,7 @@ public class Disassembly extends CDebugElement implements IDisassembly, ICDIEven
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
@Override
public Object getAdapter( Class adapter ) {
if ( IExecFileInfo.class.equals( adapter ) )
return getDebugTarget().getAdapter( adapter );