Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Fix amd64 ddb hardware watchpoints for SMP

2 views
Skip to first unread message

John Baldwin

unread,
May 20, 2013, 4:42:44 PM5/20/13
to freebs...@freebsd.org, Konstantin Belousov, am...@freebsd.org, cur...@freebsd.org
On Thursday, May 16, 2013 2:41:27 am Konstantin Belousov wrote:
> The ddb use of hardware watchpoints on the x86 architectures is known to
> be lacking. There are at least two known problems. One is the improper
> interaction with the user-mode debuggers which use debug registers.
> Another is that ddb only loads the debug registers for the watchpoint
> into the CPU which is executing ddb code, not setting up non-current
> processors.
>
> Not touching the first problem for now, I want to fix the second issue,
> since as is, hardware watchpoints are useless on SMP. Patch below makes
> the stopped processors to load the debug registers after resuming from
> the stop handler, if directed by ddb.
>
> Also the patch contains two other commands for ddb which made my
> exprerience with debugger on amd64 better. The 'show pginfo[/p] addr'
> command dumps the vm_page_t information, either by vm_page address, or,
> if the /p modifier is specified, by the physical page address. The 'show
> phys2dmap addr' command translates physical address into the directly
> mapped address, which can be accessed from ddb then.

This looks fine to me. It would be nice to fix i386 as well to be consistent.
I would commit the new DDB commands as a separate patch from the watchpoint
fixes.

--
John Baldwin
_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"

Julian Elischer

unread,
May 20, 2013, 5:15:10 PM5/20/13
to John Baldwin, Konstantin Belousov, am...@freebsd.org, cur...@freebsd.org, freebs...@freebsd.org
On 5/20/13 6:48 AM, John Baldwin wrote:
> On Thursday, May 16, 2013 2:41:27 am Konstantin Belousov wrote:
>> The ddb use of hardware watchpoints on the x86 architectures is known to
>> be lacking. There are at least two known problems. One is the improper
>> interaction with the user-mode debuggers which use debug registers.
>> Another is that ddb only loads the debug registers for the watchpoint
>> into the CPU which is executing ddb code, not setting up non-current
>> processors.
>>
>> Not touching the first problem for now, I want to fix the second issue,
>> since as is, hardware watchpoints are useless on SMP. Patch below makes
>> the stopped processors to load the debug registers after resuming from
>> the stop handler, if directed by ddb.
>>
>> Also the patch contains two other commands for ddb which made my
>> exprerience with debugger on amd64 better. The 'show pginfo[/p] addr'
>> command dumps the vm_page_t information, either by vm_page address, or,
>> if the /p modifier is specified, by the physical page address. The 'show
>> phys2dmap addr' command translates physical address into the directly
>> mapped address, which can be accessed from ddb then.
> This looks fine to me. It would be nice to fix i386 as well to be consistent.
> I would commit the new DDB commands as a separate patch from the watchpoint
> fixes.
>
the big test is to add the support in the gdb stub to use these.. :-)
0 new messages