>> Le 06/10/2018 à 05:57, Spiros Bousbouras a écrit :
>>> Just what the world needs , another text editor
>>
>
>> If I would use the gnu "gdb" I would have to generate DWARF debug info,
>> what is an horrible MESS!
>
> Why do you say that?
>
Line numbers.
Under windows (and stabs) I just have to emit a record with line, PC
address. Very easy. Under DWARF I have to make a virtual table to be
decoded with a virtual machine that has its own "instruction set". That
means I have to recreate that virtual machine when emiytting the debug
info, and when reading it. No longer possible to make an easy line+PC
address record any more.
Then, there are the abbreviations for commands, etc etc. It is
incredibly complicated. I already generated info for #defines under
windows (no other compilers did, and MSVC doesn't even today as far as I
know) gcc doesn't either because when I type any #define MACRO under gdb
it never recognizes it.
Then there is the frame information (that I already generate for my C++
interface). The problem is that the DWARF specs aren't followed neither
by gcc nor by gdb, since they "optimized" them in undocumented ways, so
that if you follow the specs it will never work. I arrived to the
conclusion that the only way to do that is to generate EXACTLY what gcc
generates, even if it is incomprehensible if you refer to the published
DWARF specs.
One of the problems also was that the assembler has some "optimizations"
that are nowhere documented concerning how it assembles the stack frame
descriptions, since it will react to some bit patterns and emit
something else to "optimize" the stack frame info.
Figuring out all this is incredibly time consuming and messy: you are at
the mercy of the whims of gcc developers that can change everything from
version X.01 to X.02 without you being able to complain or to understand
why the new gcc / gdb version doesn't work anymore.
Yes, gdb understand sometimes the stabs that I generate, but it has a
bug with 64 bit arguments using stabs, that get mangled. I sent them a
patch for that 4-5 years ago but the bug is there today. Since they do
not use stabs any more, they will never fix it.
Using my own debugger I know what is going on. I wrote one under
windows. Of course in the first time I generated debug info that the
MSVC compiler would understand (CV09 standard). But then MSVC changed in
a whim to another (undocumented) debug info format and I was left in the
cold of course. So, I kept the CV09 standard and wrote my own debugger.
For linux I would prefer avoiding gdb/gcc as much as possible (as I
avoided MSVC/CodeView under windows)