This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Virtual Machine and GDB
- From: Anupama Chandwani <anupama dot chandwani at celunite dot com>
- To: Michael dot Snyder at palmsource dot com, cjia at cse dot unl dot edu
- Cc: gdb at sourceware dot org
- Date: Mon, 21 Aug 2006 23:25:30 -0700
- Subject: Re: Virtual Machine and GDB
- Reply-to: anupama dot chandwani at celunite dot com
Hi..
>> 2) You need to teach gdb to understand the architecture of
>>your virtual machine -- the word size, the instruction language,
>> the register set, and so forth. That doesn't mean porting gdb
>> to RUN on the VM -- it just means teaching gdb how to DEBUG
>> the VM (meaning, debug something that is running in the VM).
>>
>
>How can I achieve this part? At the moment, after received a packet
>from remote GDB, I am trying to parse the packet first, and then send
>the right response to GDB. For example, if VM received a "info
>registers" command at the debug socket, it will try to collect
>register information, and then generate a right RSP message back. Or,
>if it received "next", I can set a flag in VM to indicate to only
>execute one instruction. Is that a right way to do?
>>Qian
Since you already have a communicating mechanism up, its good, u wont take much
time for including ur target in gdb. Your on right track, but after parsing wat
the packet wants just call the callback functions in gdb. Instead of setting a
flag in VM to indicate the next command, just call the function of "next" in gdb.
It will take care of the required.
Read how targets are supported by gdb, ull get a gud view of exactly wat u
have to implement.