Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Feb 2010 09:44:24 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        Anderson Eduardo <anderson_underground@hotmail.com>
Subject:   Re: Debug registers on FreeBSD
Message-ID:  <201002180944.24085.jhb@freebsd.org>
In-Reply-To: <SNT137-w4410E8A9B92233D9F9056F3470@phx.gbl>

index | next in thread | previous in thread | raw e-mail

On Wednesday 17 February 2010 11:07:36 pm Anderson Eduardo wrote:
> 
> Hello Folks,
> 
> First, I'm starting in the world of the debugging FreeBSD Kernel and, I 
don't know to use kgdb and ddb properly and, I need set breakpoints using 
debug register. Those breakpoints in the all tasks.

This last might be tricky to accomplish because cpu_switch() will swap out
the debug registers if a thread is using them.  However, you can easily
manage hardware breakpoints from ddb using the 'hwatch' command.  It is 
documented in ddb(4).  kgdb doesn't support setting hardware watch points
it seems.  Note that you can try to use 'db_md_set_watchpoint()' from your
kernel module (with DDB compiled into your kernel) if you want to set the
address progammatically rather than via the 'hwatch' command in ddb.

-- 
John Baldwin


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002180944.24085.jhb>