Page 1 of 1

GDB & DDD - change a base of data.

Posted: Sun Apr 06, 2014 1:49 pm
by wojtek
Hi everyone
Now I'm trying use GDB with Bochs,and i have a question, how change base address of data in GDB.
In example:
System is in protected mode, base of data segment is 0x500, and I set variable x=100.
Now I examine x in GDB, and he display another value.
How to get him to show the correct value of x?

Re: GDB & DDD - change a base of data.

Posted: Sun Apr 06, 2014 2:18 pm
by VolTeK
What's his name again?

Re: GDB & DDD - change a base of data.

Posted: Sun Apr 06, 2014 3:54 pm
by Nable
to wojtek:
Moving from flat binary to ELF would be (IMHO) the simplest solution for your problem.
Then you can read this and this (I've found these articles in google and they helped me, you can find something other if you don't like this set).
It looks like optional argument of add-symbol-file is what you need.

Re: GDB & DDD - change a base of data.

Posted: Sun Apr 06, 2014 4:15 pm
by wojtek
Nable wrote:Moving from flat binary to ELF would be (IMHO) the simplest solution for your problem.
I think so, but I don't know how to write simple kernel init code which support ELF.
Yet now I don't want to use Grub.
...
I decided to use GRUB...