Changeset 9534157 in rtems-tools


Ignore:
Timestamp:
Aug 26, 2017, 8:15:54 AM (23 months ago)
Author:
Cillian O'Donnell <cpodonnell8@…>
Branches:
master
Children:
4cee5c3
Parents:
cb018bc
git-author:
Cillian O'Donnell <cpodonnell8@…> (08/26/17 08:15:54)
git-committer:
Chris Johns <chrisj@…> (08/29/17 08:06:00)
Message:

covoar/ObjdumpProcessor.cc: Remove jump tables from the end of symbols.

Some tests objdumps have jump tables added to the end of them causing the
same symbols to have different sizes when processed. This removes them and
their associated errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester/covoar/ObjdumpProcessor.cc

    rcb018bc r9534157  
    346346    uint32_t           instructionOffset;
    347347    int                items;
     348    int                found;
    348349    objdumpLine_t      lineInfo;
    349350    FILE*              objdumpFile;
     
    353354    char               symbol[ MAX_LINE_LENGTH ];
    354355    char               terminator1;
     356    char               terminatorOne;
    355357    char               terminator2;
    356358    objdumpLines_t     theInstructions;
     359    char               instruction[ MAX_LINE_LENGTH ];
     360    char               ID[ MAX_LINE_LENGTH ];
     361    std::string        call = "";
     362    std::string        jumpTableID = "";
    357363
    358364    // Obtain the objdump file.
     
    408414      );
    409415
     416      // See if it is a jump table.
     417      found = sscanf(
     418        inputBuffer,
     419        "%x%c\t%*[^\t]%c%s %*x %*[^+]%s",
     420        &instructionOffset, &terminatorOne, &terminator2, instruction, ID
     421      );
     422      call = instruction;
     423      jumpTableID = ID;
     424
    410425      // If all items found, we are at the beginning of a symbol's objdump.
    411426      if ((items == 3) && (terminator1 == ':')) {
     
    438453        }
    439454      }
    440 
     455      // If it looks like a jump table, finalize the symbol.
     456      else if ( (found == 5) && (terminatorOne == ':') && (terminator2 == '\t')
     457               && (call.find( "call" ) != std::string::npos)
     458               && (jumpTableID.find( "+0x" ) != std::string::npos)
     459               && processSymbol )
     460      {
     461
     462          endAddress = executableInformation->getLoadAddress() + offset - 1;
     463
     464          // If we are currently processing a symbol, finalize it.
     465          if ( processSymbol ) {
     466            finalizeSymbol(
     467              executableInformation,
     468              currentSymbol,
     469              startAddress,
     470              endAddress,
     471              theInstructions
     472            );
     473          }
     474          processSymbol = false;
     475      }
    441476      else if (processSymbol) {
    442477
Note: See TracChangeset for help on using the changeset viewer.