Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-debug-dev] Reusing CDT gdb-MI-interface code

Thanks,

I think I will extend the classes supplied by the CDT to add another command. I just need to get (file,line) from pc, pc from (file,line) and symbol information. ( I can take it from both gdb and elf-parser )
BTW, why does elf-parser execute addr2line to get line from address ?
All the information is in the elf debug section...
Yet, you need to create parser for verious debug formats, such as dwarf or coff.

Haim

Alain Magloire wrote:
Hi,

I am using Eclipse as development platform for a DSP.

I have a question related to my debugger:
Currently, I am using gdb as static information manager (line to pc, pc to line, etc) , and the DSP simulator as the target. I have modified gdb to read the executable (ELF) and debug information (Dwarf2) and I verified that all the information I need can be retrieved from gdb. I did not implement the target support in gdb since I use it only for static information. I wonder if I can reuse CDT code that interface gdb using the MI interface, to get static information. (By 'static', I mean all the information available through gdb after loading the executable to debug, but before calling 'run' command.)

I will be happy if someone can kindly point out the classes/packages in CDT I should use/extend .

To make things clear, I will give few examples to the kind of interface I am looking for: getSourceLocationFromPc( int pc ), getPcFromSourceLocation( File file, int line ), getLocalVarsInSourceLocation( File file, int line ).



Good idea.

We did not put this in, although it should be quite easy to add it.
So far in the eclipse debug framework/UI there was no need for it.

But if you can come up with a clean Interface(set of methods) of
what you need we could work things and put it in the CDI and implement
it in the GDB/MI plugin.  The annoying thing is that GDB/MI does not
have any "mi" command for this, so we will have to send "cli" command
and do weird parsing on the output.



_______________________________________________
cdt-debug-dev mailing list
cdt-debug-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/cdt-debug-dev

--


________________________________________
Haim Cohen
Software Engineer
haim.cohen@xxxxxxxxxx
Analog Devices
Israel
(972) - 9 - 9715 406



Back to the top