mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Portable syscall inspection
@ 2007-05-28 22:59 Trent Waddington
  2007-05-29 12:35 ` Ralf Baechle
  0 siblings, 1 reply; 3+ messages in thread
From: Trent Waddington @ 2007-05-28 22:59 UTC (permalink / raw)
  To: linux-kernel

Someone finally noticed that my program that uses ptrace only works on i386..
and, by the looks of it, there is no portable way to refer to the
registers of a
user_regs_struct when inspecting a system call.

I will probably end up making a header file for each architecture that
defines where
in the user_regs_struct things like the syscall number, the return
value and the first 3 parameters are..

has anyone done this already?  or can otherwise save me a lot of time?

Thanks,

Trent

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Portable syscall inspection
  2007-05-28 22:59 Portable syscall inspection Trent Waddington
@ 2007-05-29 12:35 ` Ralf Baechle
  2007-05-31 10:27   ` Trent Waddington
  0 siblings, 1 reply; 3+ messages in thread
From: Ralf Baechle @ 2007-05-29 12:35 UTC (permalink / raw)
  To: Trent Waddington; +Cc: linux-kernel

On Tue, May 29, 2007 at 08:59:37AM +1000, Trent Waddington wrote:

> Someone finally noticed that my program that uses ptrace only works on 
> i386..
> and, by the looks of it, there is no portable way to refer to the
> registers of a
> user_regs_struct when inspecting a system call.

Correct.

> I will probably end up making a header file for each architecture that
> defines where
> in the user_regs_struct things like the syscall number, the return
> value and the first 3 parameters are..

Also consider that some architectures pass parts of the arguments in
registers which on yet others are passed in memory.  Sometimes padding
arguments are needed and many more oddities.  Similar for results.
Inescapably such a program is a perment maintenance nightmare.

> has anyone done this already?  or can otherwise save me a lot of time?

Similar things have been tried before but nothing that would be remotely
sane.

  Ralf

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Portable syscall inspection
  2007-05-29 12:35 ` Ralf Baechle
@ 2007-05-31 10:27   ` Trent Waddington
  0 siblings, 0 replies; 3+ messages in thread
From: Trent Waddington @ 2007-05-31 10:27 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-kernel

On 5/29/07, Ralf Baechle <ralf@linux-mips.org> wrote:
> Also consider that some architectures pass parts of the arguments in
> registers which on yet others are passed in memory.  Sometimes padding
> arguments are needed and many more oddities.  Similar for results.
> Inescapably such a program is a perment maintenance nightmare.

Yes, I see.  This nightmare appears to be the burden of the strace
people, god bless them.  I'm looking at moving their plethora of
#ifdefs into a library so others can be spared the nightmare.

Thanks,

Trent

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-31 10:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-28 22:59 Portable syscall inspection Trent Waddington
2007-05-29 12:35 ` Ralf Baechle
2007-05-31 10:27   ` Trent Waddington

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®