Von: Grant Edwards Gesendet am: 02 Jul 2010 16:27:35 >>> It has, however, some serious drawbacks.
> As in "it doesn't work?" :) Well this IS a drawback, isn't it? :) > Generating source listings from a linked program using objdump has > never worked for any target architecture I've tried. IMO, you're > beating your head against the wall trying to generate source listings > with objdump. The feature is there, so it was (once) supposed to work. > Generating them for individual files by passing appropriate flags to > the assembler has always worked on all the architectures I've used > (though I can't vouce for gcc 4.x on the '430, it works fine with > 3.x). Yes, and for debugging separate object files, this is okay. However, the relocations are not done (of course) and the resulting positions of the code are sometimes important. It is possible to use just the assembly listing and the individual object file listing, yet it is also possible to write complex programs in plain assembly language but this is no reason to not use a high- level language such as C. :) >> If I switch on some more info in the global .lst, the comments show >> 'File a, line x' yet the source code is from file b, line x or even >> line y. So the info is there (File a line x would be correct). Even >> the path of file a is shown correctly (so using VPATH is not >> aproblem) But then somehow things get messed up. Seems that objdump >> is unable to extract line x in file a and extracts line y from file b >> instead. > Based on how completly it's broken and how long it's been that way, I > assumed that it wasn't supposed to work... Since the source file and its complete path is known as well as the correct line number (it's properly included into the listing), there is no reason why the included source line is almost completely random. And it shouln't be difficult to fix. A Filename with path, a line number, that's C for beginners. Maybe just nobody cared for fixing it (even if it should be easy), maybe because of more importan bugs, and when these were fixed, none of the programmers remembered the bug anymore and the users had accepted it and resigned. I'd do it myself if I had a linux machine and the proper tools. Yet my company has given me a windows machine and the only programming tools are MSPGCC, AVRGCC and VisualC++. And I have different hobbies than programming in my spare time too :)