http://bugs.winehq.org/show_bug.cgi?id=20509
--- Comment #3 from Paul Bolle pebolle@tiscali.nl 2009-11-01 06:49:00 --- (In reply to comment #2)
first of all wine_segs[0..2] must be initialized to 0 in gdb_init_context
0) Only if they're not set to something meaningful before they're used. 1) The code will currently return an error packet if all three are zero.
it would be rather straightforward to get a correct value for wine_segs[0] (aka code) as it's the base address of the main module,
2) Wine's main module?
which we could get in gdb_startup
however, wine_segs[1] (aka data) would be more difficult to get note, it seems that when Data=XXX, BSS=XXX is ignored by gdb
3) According to gdb's documentation. gdb's code requires Bss=[...], even though its value must be equal to Data=[...]. Rather silly.
moreover, latest gdb version also use CodeSeg, DataSeg (instead of Code, Data) in order to provide linear addresses instead of offsets for relocation, which will be handier in our case
4) How can CodeSeg and DataSeg be determined?