* Reverse debugging for arm baremetal targets?
@ 2013-07-22 1:37 Terry Guo
2013-07-22 2:08 ` Hui Zhu
0 siblings, 1 reply; 7+ messages in thread
From: Terry Guo @ 2013-07-22 1:37 UTC (permalink / raw)
To: gdb
Hi there,
Is this feature enabled for arm baremetal targets? If not, is it
possible to do so and what kind of problems we need to solve to
achieve this? Thanks in advance for your help.
Best Regards,
Terry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Reverse debugging for arm baremetal targets?
2013-07-22 1:37 Reverse debugging for arm baremetal targets? Terry Guo
@ 2013-07-22 2:08 ` Hui Zhu
2013-07-22 6:10 ` Terry Guo
0 siblings, 1 reply; 7+ messages in thread
From: Hui Zhu @ 2013-07-22 2:08 UTC (permalink / raw)
To: Terry Guo; +Cc: gdb
On Mon, Jul 22, 2013 at 9:37 AM, Terry Guo <flameroc@gmail.com> wrote:
> Hi there,
>
> Is this feature enabled for arm baremetal targets? If not, is it
> possible to do so and what kind of problems we need to solve to
> achieve this? Thanks in advance for your help.
>
> Best Regards,
> Terry
If just for reverse debug, I think it is not depend on the arch. So I
think it is OK for ARM.
And if I remember is right, simics support it.
Thanks,
Hui
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Reverse debugging for arm baremetal targets?
2013-07-22 2:08 ` Hui Zhu
@ 2013-07-22 6:10 ` Terry Guo
2013-07-22 6:38 ` Jan Kratochvil
2013-07-22 7:26 ` Hui Zhu
0 siblings, 2 replies; 7+ messages in thread
From: Terry Guo @ 2013-07-22 6:10 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb
On Mon, Jul 22, 2013 at 10:07 AM, Hui Zhu <teawater@gmail.com> wrote:
> On Mon, Jul 22, 2013 at 9:37 AM, Terry Guo <flameroc@gmail.com> wrote:
>> Hi there,
>>
>> Is this feature enabled for arm baremetal targets? If not, is it
>> possible to do so and what kind of problems we need to solve to
>> achieve this? Thanks in advance for your help.
>>
>> Best Regards,
>> Terry
>
> If just for reverse debug, I think it is not depend on the arch. So I
> think it is OK for ARM.
>
> And if I remember is right, simics support it.
>
> Thanks,
> Hui
Thanks for your reply. I did some tests and it seems to me that
reverse debugging doesn't work for baremetal targets. My test includes
a ARM Cortex-M3 board running a baremetal program, a gdb server and a
baremetal gdb. The gdb version is:
GNU gdb (GDB) 7.6
After I connect to M3 board and run command "record", I got:
Breakpoint 1, main () at main.cpp:24
24 xyz = 0;
(gdb) record
Process record: the current architecture doesn't support record function.
(gdb) show ar
architecture args arm
(gdb) show architecture
The target architecture is set automatically (currently arm)
(gdb) n
26 foo ();
(gdb) s
foo () at main.cpp:16
16 xyz = 1;
(gdb) n
17 return bar ();
(gdb) s
bar () at main.cpp:10
10 xyz = 2;
(gdb) reverse-next
Target remote does not support this command.
Am I doing something wrong? Please advise.
BR,
Terry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Reverse debugging for arm baremetal targets?
2013-07-22 6:10 ` Terry Guo
@ 2013-07-22 6:38 ` Jan Kratochvil
2013-07-22 7:30 ` Yao Qi
2013-07-22 7:26 ` Hui Zhu
1 sibling, 1 reply; 7+ messages in thread
From: Jan Kratochvil @ 2013-07-22 6:38 UTC (permalink / raw)
To: Terry Guo; +Cc: Hui Zhu, gdb
On Mon, 22 Jul 2013 08:10:33 +0200, Terry Guo wrote:
> Thanks for your reply. I did some tests and it seems to me that
> reverse debugging doesn't work for baremetal targets.
It looks so:
$ grep ' set_gdbarch_process_record ' gdb/*
amd64-linux-tdep.c: set_gdbarch_process_record (gdbarch, i386_process_record);
arm-linux-tdep.c: set_gdbarch_process_record (gdbarch, arm_process_record);
i386-linux-tdep.c: set_gdbarch_process_record (gdbarch, i386_process_record);
moxie-tdep.c: set_gdbarch_process_record (gdbarch, moxie_process_record);
But the OS dependent part seems to be missing there:
arm-tdep.h:
/* Parse swi insn args, sycall record. */
int (*arm_swi_record) (struct regcache *regcache);
- which does not seem to be set anywhere
So the current set_gdbarch_process_record initialization could be possibly
moved to arm-tdep.c. But I did not play more with it.
Jan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Reverse debugging for arm baremetal targets?
2013-07-22 6:10 ` Terry Guo
2013-07-22 6:38 ` Jan Kratochvil
@ 2013-07-22 7:26 ` Hui Zhu
1 sibling, 0 replies; 7+ messages in thread
From: Hui Zhu @ 2013-07-22 7:26 UTC (permalink / raw)
To: Terry Guo; +Cc: gdb
On Mon, Jul 22, 2013 at 2:10 PM, Terry Guo <flameroc@gmail.com> wrote:
> On Mon, Jul 22, 2013 at 10:07 AM, Hui Zhu <teawater@gmail.com> wrote:
>> On Mon, Jul 22, 2013 at 9:37 AM, Terry Guo <flameroc@gmail.com> wrote:
>>> Hi there,
>>>
>>> Is this feature enabled for arm baremetal targets? If not, is it
>>> possible to do so and what kind of problems we need to solve to
>>> achieve this? Thanks in advance for your help.
>>>
>>> Best Regards,
>>> Terry
>>
>> If just for reverse debug, I think it is not depend on the arch. So I
>> think it is OK for ARM.
>>
>> And if I remember is right, simics support it.
>>
>> Thanks,
>> Hui
>
> Thanks for your reply. I did some tests and it seems to me that
> reverse debugging doesn't work for baremetal targets. My test includes
> a ARM Cortex-M3 board running a baremetal program, a gdb server and a
> baremetal gdb. The gdb version is:
>
> GNU gdb (GDB) 7.6
>
> After I connect to M3 board and run command "record", I got:
This error is about process record but not reverse debug.
>
> Breakpoint 1, main () at main.cpp:24
> 24 xyz = 0;
> (gdb) record
> Process record: the current architecture doesn't support record function.
This is the reason why you cannot use reverse debug commands.
You got this error is because:
/* Reversible debugging, process record. */
set_gdbarch_process_record (gdbarch, arm_process_record);
This line is called in arm_linux_init_abi but you are not a linux target.
I found all the "set_gdbarch_process_record" is called in
xxx_linux_init function make it depend on Linux.
I forget why I do it. :P
I think 2 reasons let me do it:
1. syscall record just support linux.
2. make it can pass review. :P
But most of prec function is just to record the behavior of
instruction. So maybe we can move it to arch init code.
Thanks,
Hui
> (gdb) show ar
> architecture args arm
> (gdb) show architecture
> The target architecture is set automatically (currently arm)
> (gdb) n
> 26 foo ();
> (gdb) s
> foo () at main.cpp:16
> 16 xyz = 1;
> (gdb) n
> 17 return bar ();
> (gdb) s
> bar () at main.cpp:10
> 10 xyz = 2;
> (gdb) reverse-next
> Target remote does not support this command.
>
> Am I doing something wrong? Please advise.
>
> BR,
> Terry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Reverse debugging for arm baremetal targets?
2013-07-22 6:38 ` Jan Kratochvil
@ 2013-07-22 7:30 ` Yao Qi
2013-07-22 7:34 ` Hui Zhu
0 siblings, 1 reply; 7+ messages in thread
From: Yao Qi @ 2013-07-22 7:30 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: Terry Guo, Hui Zhu, gdb
On 07/22/2013 02:38 PM, Jan Kratochvil wrote:
> But the OS dependent part seems to be missing there:
> arm-tdep.h:
> /* Parse swi insn args, sycall record. */
> int (*arm_swi_record) (struct regcache *regcache);
> - which does not seem to be set anywhere
>
I raised this question during the code review, and Oza (the author)
wanted to do them in phase 3, which handles OS related stuff, such as
syscall. What we have in trunk is phase 2.
> So the current set_gdbarch_process_record initialization could be possibly
> moved to arm-tdep.c. But I did not play more with it.
Right, the existing Oza's work in trunk is about ARM reversed debugging,
without OS stuff. Probably we should call set_gdbarch_process_record in
arm-tdep.c, but not sure how good or bad the results are.
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Reverse debugging for arm baremetal targets?
2013-07-22 7:30 ` Yao Qi
@ 2013-07-22 7:34 ` Hui Zhu
0 siblings, 0 replies; 7+ messages in thread
From: Hui Zhu @ 2013-07-22 7:34 UTC (permalink / raw)
To: Yao Qi; +Cc: Jan Kratochvil, Terry Guo, gdb
On Mon, Jul 22, 2013 at 3:29 PM, Yao Qi <yao@codesourcery.com> wrote:
> On 07/22/2013 02:38 PM, Jan Kratochvil wrote:
>>
>> But the OS dependent part seems to be missing there:
>> arm-tdep.h:
>> /* Parse swi insn args, sycall record. */
>> int (*arm_swi_record) (struct regcache *regcache);
>> - which does not seem to be set anywhere
>>
>
> I raised this question during the code review, and Oza (the author) wanted
> to do them in phase 3, which handles OS related stuff, such as syscall.
> What we have in trunk is phase 2.
>
>
>> So the current set_gdbarch_process_record initialization could be possibly
>> moved to arm-tdep.c. But I did not play more with it.
>
>
> Right, the existing Oza's work in trunk is about ARM reversed debugging,
> without OS stuff. Probably we should call set_gdbarch_process_record in
> arm-tdep.c, but not sure how good or bad the results are.
I think you should call it arm process record but not reverse debug.
Reverse debug depend on the target support but I don't think call prec
as reverse debug is right.
Thanks,
Hui
>
> --
> Yao (齐尧)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-07-22 7:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-22 1:37 Reverse debugging for arm baremetal targets? Terry Guo
2013-07-22 2:08 ` Hui Zhu
2013-07-22 6:10 ` Terry Guo
2013-07-22 6:38 ` Jan Kratochvil
2013-07-22 7:30 ` Yao Qi
2013-07-22 7:34 ` Hui Zhu
2013-07-22 7:26 ` Hui Zhu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox