Re: Writing a full-screen debugger.



This is rather off-topic for gtk-list, but I'll answer a bit here
anyways.

jca <jca@mail.phm.vcu.edu> writes:

>   I've thought about writing my own little custom IDE in Gtk, most of
> the functions seem simple enough: a text editor + the abililty to call
> gcc thru a shell.
> 
>   But the most useful feature of IDEs, step-through-debugging, is still
> elusive to me.  I don't mean a command-line gdb as in Emacs, but the
> full screen walkthrough available in Rhide or the old Xwpe...
> 
>   Does anyone here know (basically) how full-screen debuggers work?
> 
>   1. Do they reference the standard Linux gdb somehow, or would their
> authors have had to write new debuggers from scratch, to make
> stepping-through interact with their GUI?

There are various approaches:

 - Talk to gdb using a pipe, as if your full-screen debugger was a user.
   (examples. - kgdb, ddd)

 - Link directly to gdb. (example - the Insight debugger. Quite a
   nice tool ... you should definitely look at this one.)

 - New in gdb 5.0, gdb has a secondary interface called GDB/MI which
   is described in the info pages pretty completely. MI == machine
   interface, and is meant for interaction with a GUI debugger.

   This one is most likely the best way to go. Again you talk to
   a gdb process via a pipe, but the command language is designed
   for the task rather than for human interaction.
 
>   2.  What is the technical principle of a debugger, is it an
> interpreter that treats machine language as a sort of bytecode and runs
> it in a 'virtual' environment?  Or something else?

It attaches to the running process using kernel and processor features.
 
>   And...  If writing a full-screen debugger does require starting from
> scratch (can't use gdb), are there some nice libraries out there with
> most of the debugging functions already written?

Not really. (libbfd sort of falls into the general category, but it
is not nice and only has tiny fraction of the functionality there.)

                                        Owen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]