Re: record mode supposed to work on x86_64-linux?

Hui Zhu
2009-05-17T00:15:11Z

[-- Attachment #1: Type: text/plain, Size: 1474 bytes --]

Hi Pedro,

What do you think about this one?

2009-05-17 Hui Zhu <teawater@gmail.com>

* i386-tdep.c (i386_process_record): Remove the static of it.
(i386_gdbarch_init): Remove the set_gdbarch_process_record.
* i386-tdep.c (i386_process_record): New extern.
* i386-linux-tdep.c (i386_linux_init_abi): Call
set_gdbarch_process_record.

Sorry for my always understand your mean so slow. :)

Thanks,
Hui

On Sun, May 17, 2009 at 00:35, Pedro Alves <pedro@codesourcery.com> wrote:
> On Saturday 16 May 2009 10:51:42, Hui Zhu wrote:
>> Sorry.  I made a mistake in gdbarch.sh.
>> How about this one?
>
> There's no need for a new gdbarch method if you
> implement what I suggested before:
>
>  http://sourceware.org/ml/gdb-patches/2009-05/msg00267.html
>
>>
>> Thanks,
>> Hui
>>
>> On Sat, May 16, 2009 at 17:27, Andi Kleen <andi@firstfloor.org> wrote:
>> > On Sat, May 16, 2009 at 05:09:12PM +0800, Hui Zhu wrote:
>> >> Hi Andi,
>> >>
>> >> Thanks for remind me.
>> >> I make a patch for it.  But I don't have a x86-64 close to me now.
>> >> Could you help me test it?
>> >
>> > Gets
>> >
>> > ../../src/gdb/gdbarch.c:648: internal-error: verify_gdbarch: the following are invalid ...
>> >        support_process_record
>> > A problem internal to GDB has been detected,
>> > further debugging may prove unreliable.
>> >
>> > at startup. I haven't tried further.
>> >
>> > -Andi
>> >
>>
>
>
>
> --
> Pedro Alves
>

[-- Attachment #2: prec_move_to_target.txt --]
[-- Type: text/plain, Size: 1580 bytes --]

---
i386-linux-tdep.c | 2 ++
i386-tdep.c | 4 +---
i386-tdep.h | 3 +++
3 files changed, 6 insertions(+), 3 deletions(-)

--- a/i386-linux-tdep.c
+++ b/i386-linux-tdep.c
@@ -613,6 +613,8 @@ i386_linux_init_abi (struct gdbarch_info
tdep->sc_reg_offset = i386_linux_sc_reg_offset;
tdep->sc_num_regs = ARRAY_SIZE (i386_linux_sc_reg_offset);

+ set_gdbarch_process_record (gdbarch, i386_process_record);
+
/* Initialize the i386_linux_record_tdep. */
i386_linux_record_tdep.size__old_kernel_stat =
I386_LINUX_RECORD_SIZE__old_kernel_stat;
--- a/i386-tdep.c
+++ b/i386-tdep.c
@@ -2982,7 +2982,7 @@ i386_record_lea_modrm (struct i386_recor
memory that will be changed in current instruction to "record_arch_list".
Return -1 if something wrong. */

-static int
+int
i386_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
CORE_ADDR addr)
{
@@ -5277,8 +5277,6 @@ i386_gdbarch_init (struct gdbarch_info i
set_gdbarch_skip_permanent_breakpoint (gdbarch,
i386_skip_permanent_breakpoint);

- set_gdbarch_process_record (gdbarch, i386_process_record);
-
return gdbarch;
}

--- a/i386-tdep.h
+++ b/i386-tdep.h
@@ -220,6 +220,9 @@ extern void i386_elf_init_abi (struct gd

/* Initialize a SVR4 architecture variant. */
extern void i386_svr4_init_abi (struct gdbarch_info, struct gdbarch *);
+
+extern int i386_process_record (struct gdbarch *gdbarch,
+ struct regcache *regcache, CORE_ADDR addr);
\f

/* Functions and variables exported from i386bsd-tdep.c. */