Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eclipse debugging shows source files with wrong line numbers

when I click F3 and drill down into a method definition, eclipse goes into a dependency jar. ----- first question: where did it get the source file? I don't see the jars containing actual source files, did it decompile ? ---- I set a breakpoint, and run debug.

but the debugging process never seems to land on the correct breakpoint, and the breakpoint I set is rarely executed. it turns out that the source code shown is wrong, so that the breakpoint is set at wrong locations too.

here is what I see from eclipse window:

/*     */   public <T> T execute(URI url, HttpMethod method, RequestCallback requestCallback, ResponseExtractor<T> responseExtractor)
/*     */     throws RestClientException
/*     */   {
/* 415 */     return doExecute(url, method, requestCallback, responseExtractor);
/*     */   }`

the comment before each line seems to show the correct line number, but they do not match up with their true line number shown on the left of the eclipse window frame. i.e. the above code segment occupies lines 315--319 in the window, not 415.

so how can I grab the correct sources and display them in my debugging process? do I have to manually grab all the jars ? is there a way to specify in my pom file?

thanks Yang

like image 317
teddy teddy Avatar asked May 09 '13 20:05

teddy teddy


People also ask

How do I change debug value in Eclipse?

Click on Window -> Open Perspective -> Debug. Click on Tab Variables. Right click the variable for which you want to change the value and click on Change Value... Set the Value as Boolean.

How do I show variables in debugging in Eclipse?

Highlight the variable or expression while debugging, right-click it, and select Watch, or select Run→ Watch. The variable or expression, along with its value, will appear in the Expressions view from then on.

What is Remote debugging in Eclipse?

The remote debugging of the Java program is an ultimate tool in the arsenal of a Java developer, which is often becoming the last and only tool to investigate a bug on a Java application running on the remote host like on a Linux server or Windows server.


1 Answers

In Eclipse, you can specify the sources for debugging under Run -> Debug Configurations. Select your Debug configuration from the list and configure the Source lookup path in the 'Source' tab

like image 111
klib009 Avatar answered Sep 27 '22 21:09

klib009