| Summary: | Getting source code positions for advice | ||
|---|---|---|---|
| Product: | [Tools] AspectJ | Reporter: | yoav <yoav_> |
| Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | aclement, yoav_ |
| Version: | 1.6.5 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
Do you want to contribute a patch for this? I would say take a look at where the sourcelocations are setup for advice and see if the information is just not being passed through. If it's just some assignment missing I can try. Can you point me where to look? I'm not familiar with the front end code. the more i think about it, the more I'm just not sure you'll get what you want - do you want the line with the last bit of code on or the line with the closing curly brace on? When binary weaving without a preceeding compile, the position of the final closing } just cannot be determined, but the location of the final bit of code should be there (as it will be the last occuring entry in the line number table). Perhaps the simplest thing to do here is just understand why you can't get what you want from the line number table. I'm porting a code that was based on the ABC compiler which queries for this info. I'm not sure if it was used for anything useful though. I will try for now to use the info from the line number table. |
Build Identifier: 20110301-1815 Source code position is not available in BcelAdvice Reproducible: Always Steps to Reproduce: I'm trying to extract source file information during the weaving process. I wrote the following code to fetch the beginning and end of an advice: public String getAdviceFormatString(BcelAdvice adv) { ISourceLocation pos = adv.getSourceLocation(); int startLine = pos.getLine(); int endLine = pos.getEndLine(); // do the rest } I always get that startLine == endLine which correspond to the first line of the advice declaration.