public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Amit S. Kale" <amitkale@emsyssoft.com>
To: Tom Rini <trini@kernel.crashing.org>,
	kgdb-bugreport@lists.sourceforge.net,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [Kgdb-bugreport] Document hooks in kgdb
Date: Wed, 24 Mar 2004 20:11:26 +0530	[thread overview]
Message-ID: <200403242011.26314.amitkale@emsyssoft.com> (raw)
In-Reply-To: <20040319162009.GE4569@smtp.west.cox.net>

That's a good idea. Go ahead.
-Amit
On Friday 19 Mar 2004 9:50 pm, Tom Rini wrote:
> Hi.  The following is my first attempt at documenting the hooks found in
> the KGDB found on kgdb.sf.net.  I'm not quite sure about the description
> of some of the optional hooks (used under hw breakpoints) so corrections
> / suggestions welcome.  After I got done with it, it hit me that maybe I
> should have done this in the code, and in DocBook format, so I'll go and
> do that next...
>
> <-- snip -->
> This is an attempt to document the various architecture specific functions
> that are part of KGDB.  There are a number of optional functions, depending
> on hardware setps, for which empty defaults are provided.  There are also
> functions which must be implemented and for which no default is provided.
>
> The required functions are:
> int kgdb_arch_handle_exception(int vector, int signo, int err_code,
> 		char *InBuffer, char *outBuffer, struct pt_regs *regs)
> 	This function MUST handle the 'c' and 's' command packets,
> 	as well packets to set / remove a hardware breakpoint, if used.
>
> void regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
> 	Convert the ptrace regs in regs into what GDB expects to
> 	see for registers, in gdb_regs.
>
> void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct
> task_struct *p) Like regs_to_gdb_regs, except that the process in p is
> sleeping,
> 	so we cannot get as much information.
>
> void gdb_regs_to_regs(unsigned long *gdb_regs, struct pt_regs *regs)
> 	Convert the GDB regs in gdb_regs into the ptrace regs pointed
> 	to in regs.
>
> The optional functions are:
> int kgdb_arch_init(void) :
> 	This function will handle the initalization of any architecture
> 	specific hooks.  If there is a suitable early output driver,
> 	kgdb_serial can be pointed at it now.
>
> void kgdb_printexceptioninfo(int exceptionNo, int errorcode, char *buffer)
> 	Write into buffer and information about the exception that has
> 	occured that can be gleaned from exceptionNo and errorcode.
>
> void kgdb_disable_hw_debug(struct pt_regs *regs)
> 	Disable hardware debugging while we are in kgdb.
>
> void kgdb_correct_hw_break(void)
> 	A hook to allow for changes to the hardware breakpoint, called
> 	after a single step (s) or continue (c) packet, and once we're about
> 	to let the kernel continue running.
>
> void kgdb_post_master_code(struct pt_regs *regs, int eVector, int err_code)
> 	Store the raw vector and error, for later retreival.
>
> void kgdb_shadowinfo(struct pt_regs *regs, char *buffer, unsigned threadid)
> struct task_struct *kgdb_get_shadow_thread(struct pt_regs *regs, int
> threadid) struct pt_regs *kgdb_shadow_regs(struct pt_regs *regs, int
> threadid) If we have a shadow thread (determined by setting
> 	kgdb_ops->shadowth = 1), these functions are required to return
> 	information about this thread.

An addition: shadow threads are needed to provide information not retrievable 
by gdb. e.g. Backtraces beyond interrupt entrypoints, that aren't retrievable 
in absence of debugging info for interrupt entrypoint code.

Rest is fine.
-Amit


  reply	other threads:[~2004-03-24 14:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-19 16:20 Document hooks in kgdb Tom Rini
2004-03-24 14:41 ` Amit S. Kale [this message]
2004-03-24 15:43   ` [Kgdb-bugreport] " Tom Rini
2004-03-25  4:52     ` Amit S. Kale
2004-03-25 15:14       ` Tom Rini
2004-03-31 15:29         ` Latest kgdb? Pavel Machek
2004-03-31 15:45           ` Tom Rini
2004-03-31 16:08             ` Pavel Machek
2004-03-31 16:12               ` Tom Rini
2004-04-01  5:39                 ` [Kgdb-bugreport] " Amit S. Kale

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=200403242011.26314.amitkale@emsyssoft.com \
    --to=amitkale@emsyssoft.com \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trini@kernel.crashing.org \
    /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