1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-20 23:45:23 +02:00

[266105] Unable to see DSF disassembly

This commit is contained in:
Anton Leherbauer 2009-02-25 16:16:46 +00:00
parent 412ba1852c
commit 626108adc3

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2008 Wind River Systems, Inc. and others. * Copyright (c) 2008, 2009 Wind River Systems, Inc. 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
@ -178,10 +178,12 @@ public class BreakpointsAnnotationModel extends AnnotationModel implements IBrea
} }
private Position createPositionFromAddress(BigInteger address) { private Position createPositionFromAddress(BigInteger address) {
if (address != null) {
AddressRangePosition p= getDisassemblyDocument().getDisassemblyPosition(address); AddressRangePosition p= getDisassemblyDocument().getDisassemblyPosition(address);
if (p != null && p.fValid) { if (p != null && p.fValid) {
return new Position(p.offset, p.length); return new Position(p.offset, p.length);
} }
}
return null; return null;
} }
@ -195,14 +197,21 @@ public class BreakpointsAnnotationModel extends AnnotationModel implements IBrea
* *
* @param string * @param string
* decimal or hexadecimal representation of an non-negative integer * decimal or hexadecimal representation of an non-negative integer
* @return address value as <code>BigInteger</code> * @return address value as <code>BigInteger</code> or <code>null</code> in case of a <code>NumberFormatException</code>
*/ */
private static BigInteger decodeAddress(String string) { private static BigInteger decodeAddress(String string) {
try {
if (string.startsWith("0x")) { //$NON-NLS-1$ if (string.startsWith("0x")) { //$NON-NLS-1$
return new BigInteger(string.substring(2), 16); return new BigInteger(string.substring(2), 16);
} }
if (string.length() > 0) {
return new BigInteger(string); return new BigInteger(string);
} }
} catch (NumberFormatException nfe) {
// don't propagate
}
return null;
}
/* /*
* @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent) * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)