This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Virtual Machine and GDB


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.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]