Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org,  Eli Zaretskii <eliz@gnu.org>
Cc: bauerman@br.ibm.com,  sergiodj@linux.vnet.ibm.com
Subject: Re: [PATCH 1/4] 'catch syscall' feature -- 	Architecture-independent	part
Date: Thu, 06 Nov 2008 14:32:00 -0000	[thread overview]
Message-ID: <200811061426.45512.pedro@codesourcery.com> (raw)
In-Reply-To: <ubpwttr99.fsf@gnu.org>

On Thursday 06 November 2008 04:25:38, Eli Zaretskii wrote:

> You said (or so I thought) that instead of watching the call to
> ReadFile, one can watch some equivalent call to Int 2Eh which ReadFile
> issues eventually, just like `read' does on Unix:

I said it ends up calling the syscall (as in, it calls some function, that
calls some function, that ..., that ends up calling the syscall), but
I didn't say we can "watch it".  AFAIK, there's no debug event to trap
on it.

> 
> > Eventually the libc 'read' function calls the real 'read' syscall,
> > just like on Windows.
> 
> I'm saying that I don't think such a function of Int 2Eh exists,
> because I think only lower-level sector-oriented disk read commands
> are implemented as software interrupts, and all the higher level
> processing needed for reading the file are not in kernel space.
> 
> > In NT the Win32 API functions are regular functions that are
> > implemented on top of OS services.  The kernel knows nothing about the
> > win32 API.  E.g., the ReadFile function is a wrapper around
> > the user land NtReadFile, which itself is what does the syscall.
> 
> But NtReadFile is also a function, not an Int 2Eh syscall, right?
> 

I thought that was clear from
"user land NtReadFile, which itself is what does the syscall".
I pointed at an url explaining how syscalls are done on NT.

Here's another one, which should be more clear:

 http://www.ddj.com/184410109

And linked from it, you'll find the disassembly of NtCreateFile:

 http://www.ddj.com/showArticle.jhtml?documentID=ddj9701e&pgno=2

The point I am making, is that what you wanted to bind to "catch syscall"
is in fact api-tracing --- tracing normal function calls, which you can do
with breakpoints, and isn't specific to Windows.  I mentioned or implied 
that most users would want to trace Win32 api calls, but those are
not "system calls".  I gave the example of ReadFile.

I mentioned that probably, you could get away with putting breakpoints
on the ntdll functions that themselves do the syscalls, but I didn't
say that's the only way.  There could be other better ways.

Please, let's stop this "I said you said" nonsense.

-- 
Pedro Alves


  reply	other threads:[~2008-11-06 14:32 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-04  4:32 Sérgio Durigan Júnior
2008-11-04 16:17 ` Pedro Alves
2008-11-07  3:30   ` Sérgio Durigan Júnior
2008-11-07 12:12     ` Pedro Alves
2008-11-07 13:30       ` Daniel Jacobowitz
2008-11-08 15:35       ` Sérgio Durigan Júnior
2008-11-04 17:57 ` Tom Tromey
2008-11-04 21:55   ` Thiago Jung Bauermann
2008-11-04 22:33     ` Tom Tromey
2008-11-05 19:05       ` Tom Tromey
2008-11-05 19:13         ` Sérgio Durigan Júnior
2008-11-07  3:41         ` Sérgio Durigan Júnior
2008-11-07  3:39   ` Sérgio Durigan Júnior
2008-11-07 18:21     ` Tom Tromey
2008-11-04 21:13 ` Eli Zaretskii
2008-11-04 22:12   ` Thiago Jung Bauermann
2008-11-04 22:22     ` Eli Zaretskii
2008-11-04 22:35       ` Daniel Jacobowitz
2008-11-05  4:19         ` Eli Zaretskii
2008-11-05 13:34           ` Sérgio Durigan Júnior
2008-11-05 18:42             ` Eli Zaretskii
2008-11-08 19:31             ` Mark Kettenis
2008-11-05 14:55           ` Daniel Jacobowitz
2008-11-05 18:43             ` Eli Zaretskii
2008-11-05 18:59               ` Daniel Jacobowitz
2008-11-05 19:11                 ` Eli Zaretskii
2008-11-06 23:03               ` Mark Kettenis
2008-11-04 22:31     ` Pedro Alves
2008-11-05  4:10       ` Eli Zaretskii
2008-11-05 12:29         ` Pedro Alves
2008-11-05 18:38           ` Eli Zaretskii
2008-11-05 18:57             ` Pedro Alves
2008-11-05 19:10               ` Eli Zaretskii
2008-11-05 19:34                 ` Pedro Alves
2008-11-05 20:36                   ` Eli Zaretskii
2008-11-05 21:10                     ` Pedro Alves
2008-11-06  4:27                       ` Eli Zaretskii
2008-11-06 14:32                         ` Pedro Alves [this message]
2008-11-07  9:59                           ` Eli Zaretskii
2008-11-07 10:10                             ` Pedro Alves
2008-11-05 13:32         ` Mark Kettenis
  -- strict thread matches above, loose matches on Subject: below --
2008-09-30 18:12 Sérgio Durigan Júnior
2008-10-02 21:13 ` Joel Brobecker
2008-10-03  2:33   ` Sérgio Durigan Júnior
2008-10-03  6:07     ` Joel Brobecker
2008-10-03 17:52       ` Daniel Jacobowitz
2008-10-04 23:07         ` Sérgio Durigan Júnior
2008-10-04 23:04       ` Sérgio Durigan Júnior
2008-10-06 17:22         ` Joel Brobecker
2008-10-10 13:12           ` Daniel Jacobowitz
2008-10-10 15:28           ` Sérgio Durigan Júnior
2008-10-12  2:26           ` Sérgio Durigan Júnior
2008-10-15  5:40             ` Joel Brobecker
2008-10-16  3:35               ` Sérgio Durigan Júnior
2008-10-16 12:37                 ` Daniel Jacobowitz
2008-10-16 15:17                   ` Daniel Jacobowitz
2008-10-16 16:28                     ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200811061426.45512.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=bauerman@br.ibm.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox