[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to determine the order of the registers got, their width and cou
From: |
Sergio Durigan Junior |
Subject: |
Re: How to determine the order of the registers got, their width and count? |
Date: |
Mon, 09 Jun 2014 01:55:09 -0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) |
On Friday, June 06 2014, Ananda Vardhana wrote:
> I am newbie in GDB. I had couple of questions
Hello Ananda,
I don't really have time to answer all of your questions now; I'd
strongly recommend that you send them to <address@hidden>, which is
the official mailing list for GDB (this one is just a placeholder).
> 1. When I send out 'g' I get a full dump of the registers. Is there 'q'
> query packet I can send and ask the GDB server in what order(eax, ebx, ecx
> ...) will it dump the registers?
AFAIK, no, there isn't. From the GDB manual:
Each byte of register data is described by two hex digits. The bytes
with the register are transmitted in target byte order. The size of
each register and their position within the āgā packet are determined
by the GDB internal gdbarch functions DEPRECATED_REGISTER_RAW_SIZE and
gdbarch_register_name.
So you'd have to check gdbarch_register_name in order to obtain this
information.
> 2. Before we do a 'g' can we tell the server that we are interested in
> 32 bit (EAX, ECX etc ...) only?
I don't think you can. You can read the registers separately, though.
> 3. Can I send out a 'q' packet and ask the server whether it will give
> me back 32 or 64 bit registers?
I don't understand this question. If you're interested in reading some
specific register, you can do that. Otherwise, using the 'g' packet,
you will obtain all of them.
I'll see if I can answer your other questions when I have more time.
--
Sergio
GPG key ID: 65FC5E36
Please send encrypted e-mail if possible
http://blog.sergiodj.net/