public void FindNearestSymbol(DbgViewSymbol aSymbolView)
        {
            SymbolCollection collection = null;

            iSymbol = aSymbolView.Lookup(this.Data, out collection);
            //
            if (collection != null)
            {
                // FIXME: should this be device file name if available, and host file name if all else fails?
                AssociatedBinary = Path.GetFileName(collection.FileName.FileNameInHost);
            }
        }
Example #2
0
        private void CalculatePrologueInstructionCount()
        {
            DbgViewSymbol symbolView = iEngine.DebugEngineView.Symbols;

            // Get the PC and try to match it to a function
            SymbolCollection collection = null;
            Symbol           symbol     = symbolView.Lookup(iPC, out collection);

            if (symbol != null)
            {
                iFunctionStartAddress = symbol.Address;
                iFunctionName         = symbol.Name;
                //
                uint offset                   = FunctionOffsetToPC;
                uint instructionSize          = SingleInstructionSize;
                uint prologueInstructionCount = (offset / instructionSize);
                //
                iEngine.Trace("[PLG] Prologue function: 0x{0:x8} = {1} [+{2:x4}], {3} instructions", iPC.Value, iFunctionName, offset, PrologueInstructionCount);
                PrologueInstructionCount = (int)prologueInstructionCount;
            }
            else
            {
                // We could not locate the symbol for the corresponding program counter address.
                // In this situation, there's nothing we can do - if we cannot work out the offset
                // within the function, then we cannot identify how many Prologue instructions to
                // attempt to read.
                //
                // If the symbol was not found because no code segment claims ownership of this address
                // then that might indicate premature dll unload or bad crash data (missing code segments)
                if (collection == null)
                {
                    throw new APESymbolNotFoundCodeSegmentUnavailable(iPC);
                }
                else
                {
                    throw new APESymbolNotFound(iPC, string.Format("Code segment \'{0}\' should describe symbol, but none was found for requested program counter address", collection.FileName));
                }
            }
        }
Example #3
0
        private Symbol BaseAddressSymbolAndCollection(DbgViewSymbol aSymbolView, out SymbolCollection aCollection)
        {
            Symbol ret = aSymbolView.Lookup(this.Base, out aCollection);

            return(ret);
        }