Skip to contentSkip to conversation

gdbserver on sh4

DISCUSSION Michael Trimarchi 2 participants 5 messages Mar 31, 2009 SuperH

lore
Share & tools
lore
#0 lore raw

Hi,

Quoted 6 lines · binom

Dear michael ,
In your reply message it's written that "I fix this problem". Can you pl explain what was the problem and and which is the components to be updated for incorporating this fix?
Below given is the details of the host side GDB and target side gdbserver.
sh4-linux-gdb --version

Quoted 9 lines

GNU gdb STMicroelectronics/Linux Base 6.5-33 [build Jul 30 2008] Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i686-pc-linux-gnu --target=sh4-linux".

The problem is kernel side and not gdb side. I send a patch to the linux-sh mailing list. They save the dsp register on the stack before the processor cpu register
but the offset of the struct is wrong calculated and if the linux kernel is compiled
with the dsp option the PEEKUSR return the wrong register value.

Michael

#1 lore raw
Quoted 17 lines · Michael Trimarchi
Quoted 7 lines · binom

Dear michael ,
In your reply message it's written that "I fix this problem". Can you pl explain what was the problem and and which is the components to be updated for incorporating this fix?
Below given is the details of the host side GDB and target side gdbserver. sh4-linux-gdb --version
GNU gdb STMicroelectronics/Linux Base 6.5-33 [build Jul 30 2008]

Quoted 9 lines

Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i686-pc-linux-gnu --target=sh4-linux".

Quoted 7 lines

The problem is kernel side and not gdb side. I send a patch to the linux-sh mailing list. They save the dsp register on the stack before the processor cpu register
but the offset of the struct is wrong calculated and if the linux kernel is compiled
with the dsp option the PEEKUSR return the wrong register value.

The sanest thing really is just to throw the DSP state in to the thread struct as we do with the FPU, and kill off all of the special DSP state handling we have today. It costs us a thread flag to do lazy context switching, but it's worth it to get that crap out of the regular register save/restore paths, which is just way too fragile, and has not seen any real maintenance since SH3-DSP.

#2 lore raw
In reply to Michael Trimarchi
Quoted 30 lines · Paul Mundt
Quoted 19 lines · Michael Trimarchi
Quoted 7 lines · binom

Dear michael ,
In your reply message it's written that "I fix this problem". Can you pl explain what was the problem and and which is the components to be updated for incorporating this fix?
Below given is the details of the host side GDB and target side gdbserver. sh4-linux-gdb --version
GNU gdb STMicroelectronics/Linux Base 6.5-33 [build Jul 30 2008]

Quoted 10 lines

Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i686-pc-linux-gnu --target=sh4-linux".

Quoted 9 lines

The problem is kernel git clone git://git.openmoko.org/git/kernel.git linux-2.6 side and not gdb side. I send a patch to the linux-sh
mailing list. They save the dsp register on the stack before the processor cpu register
but the offset of the struct is wrong calculated and if the linux kernel is compiled
with the dsp option the PEEKUSR return the wrong register value.

Quoted 4 lines

The sanest thing really is just to throw the DSP state in to the thread struct as we do with the FPU, and kill off all of the special DSP state handling we have today. It costs us a thread flag to do lazy context

I just send a patch that put the dsp state in the thread struct

Quoted 4 lines

switching, but it's worth it to get that crap out of the regular register save/restore paths, which is just way too fragile, and has not seen any real maintenance since SH3-DSP.

So move the save/restore part of the dsp in private data of task and do like mips?

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Michael

#3 lore raw
In reply to Michael Trimarchi
Quoted 8 lines · Michael Trimarchi
Quoted 7 lines · Paul Mundt
Quoted 6 lines · Michael Trimarchi

The problem is kernel side and not gdb side. I send a patch to the linux-sh mailing list. They save the dsp register on the stack before the processor cpu register but the offset of the struct is wrong calculated and if the linux kernel is compiled with the dsp option the PEEKUSR return the wrong register value.

Quoted 5 lines
Quoted 4 lines

The sanest thing really is just to throw the DSP state in to the thread struct as we do with the FPU, and kill off all of the special DSP state handling we have today. It costs us a thread flag to do lazy context

I just send a patch that put the dsp state in the thread struct

You sent a patch that cached the enable/disable state in the thread struct, not the register state. ;-)

Quoted 6 lines
Quoted 4 lines

switching, but it's worth it to get that crap out of the regular register save/restore paths, which is just way too fragile, and has not seen any real maintenance since SH3-DSP.

So move the save/restore part of the dsp in private data of task and do like mips?

Yes.

#4 lore raw
In reply to Michael Trimarchi

Hi,

Quoted 30 lines · Paul Mundt
Quoted 11 lines · Michael Trimarchi
Quoted 9 lines · Paul Mundt
Quoted 7 lines · Michael Trimarchi

The problem is kernel side and not gdb side. I send a patch to the linux-sh mailing list. They save the dsp register on the stack before the processor cpu register but the offset of the struct is wrong calculated and if the linux kernel is compiled with the dsp option the PEEKUSR return the wrong register value.

Quoted 7 lines
Quoted 5 lines

The sanest thing really is just to throw the DSP state in to the thread struct as we do with the FPU, and kill off all of the special DSP state handling we have today. It costs us a thread flag to do lazy context

I just send a patch that put the dsp state in the thread struct

You sent a patch that cached the enable/disable state in the thread struct, not the register state. ;-)

Quoted 5 lines
Quoted 5 lines

switching, but it's worth it to get that crap out of the regular register save/restore paths, which is just way too fragile, and has not seen any real maintenance since SH3-DSP.

Quoted 6 lines
Quoted 3 lines

So move the save/restore part of the dsp in private data of task and do like mips?

Yes.

Ok, I will try to provide a new patch to move out the dsp save/restore part from the
stack and move all on the thread privata data.

Michael

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html