How to enable hardware breakpoint support

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to enable hardware breakpoint support

DeD MustDIE
Hi.

I have same problem on 2 different machines.

GBD can set only software breakpoint but not hardware.

Example:

gdb -q `which df`

(gdb) hb *0x400d70
No hardware breakpoint support in the target.


First machine is my workstation.

Intel(R) Pentium(R) 4 CPU 3.06GHz
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc
pebs bts pni dtes64 monitor ds_cpl tm2 cid cx16 xtpr lahf_lm

Linux miha-desktop 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16
20:36:48 UTC 2010 i686 GNU/Linux

GNU gdb (GDB) 7.2-ubuntu

Second one is server:

CPU: Intel(R) Xeon(R) CPU            5120  @ 1.86GHz (1862.06-MHz K8-class CPU)
Features=<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
Features2=<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,DCA>
AMD Features=0x20000800<SYSCALL,LM>
AMD Features2=0x1<LAHF>

FreeBSD 8.1-RELEASE-p1 Thu Oct  7 18:29:43 MSD 2010  amd64 custom kernel

GNU gdb 6.6 [GDB v6.6 for FreeBSD]
or
GNU gdb 6.1.1 [FreeBSD]

------------------------------
Laletin Michael
Reply | Threaded
Open this post in threaded view
|

Re: How to enable hardware breakpoint support

Pedro Alves-10
On Thursday 18 November 2010 09:33:19, DeD MustDIE wrote:

> GBD can set only software breakpoint but not hardware.
>
> Example:
>
> gdb -q `which df`
>
> (gdb) hb *0x400d70
> No hardware breakpoint support in the target.

Run to main first, for example with the "start" command.
Then it should work.

--
Pedro Alves
Reply | Threaded
Open this post in threaded view
|

Re: How to enable hardware breakpoint support

DeD MustDIE
Thank you.
I was not careful. On workstation (Ubuntu) hardware breakpoints work
fine. I really forgot to run program.
But on server (FreeBSD) hardware breakpoints still not working.

On Thu, Nov 18, 2010 at 14:32, Pedro Alves <[hidden email]> wrote:

> On Thursday 18 November 2010 09:33:19, DeD MustDIE wrote:
>
>> GBD can set only software breakpoint but not hardware.
>>
>> Example:
>>
>> gdb -q `which df`
>>
>> (gdb) hb *0x400d70
>> No hardware breakpoint support in the target.
>
> Run to main first, for example with the "start" command.
> Then it should work.
>
> --
> Pedro Alves
>
Reply | Threaded
Open this post in threaded view
|

Re: How to enable hardware breakpoint support

Pedro Alves-10
On Thursday 18 November 2010 13:18:55, DeD MustDIE wrote:
> Thank you.
> I was not careful. On workstation (Ubuntu) hardware breakpoints work
> fine. I really forgot to run program.
> But on server (FreeBSD) hardware breakpoints still not working.

AFAICS, an x86 FBSD gdb should support hardware breakpoints and
watchpoints.  I don't see an x64_64/amd64 FreeBSD port in the FSF GDB
tree, so it may be your GDB has local changes to support it
that missed adding the HW breakpoint support.

--
Pedro Alves
Reply | Threaded
Open this post in threaded view
|

Re: How to enable hardware breakpoint support

Pedro Alves-10
On Thursday 18 November 2010 13:43:24, Pedro Alves wrote:

> On Thursday 18 November 2010 13:18:55, DeD MustDIE wrote:
> > Thank you.
> > I was not careful. On workstation (Ubuntu) hardware breakpoints work
> > fine. I really forgot to run program.
> > But on server (FreeBSD) hardware breakpoints still not working.
>
> AFAICS, an x86 FBSD gdb should support hardware breakpoints and
> watchpoints.  I don't see an x64_64/amd64 FreeBSD port in the FSF GDB
> tree, so it may be your GDB has local changes to support it
> that missed adding the HW breakpoint support.

Actually, that's nonsense.  There's an x86_64-freebsd port in mainline
indeed.   But, it doesn't seem to install the necessary hooks for
hardware breakpoints or watchpoints support.  Don't know
more than that though.  And I didn't check older gdb's either.

--
Pedro Alves
Reply | Threaded
Open this post in threaded view
|

Re: How to enable hardware breakpoint support

DeD MustDIE
Thank you very much. I will find another way to debug.


On Thu, Nov 18, 2010 at 17:38, Pedro Alves <[hidden email]> wrote:

> On Thursday 18 November 2010 13:43:24, Pedro Alves wrote:
>> On Thursday 18 November 2010 13:18:55, DeD MustDIE wrote:
>> > Thank you.
>> > I was not careful. On workstation (Ubuntu) hardware breakpoints work
>> > fine. I really forgot to run program.
>> > But on server (FreeBSD) hardware breakpoints still not working.
>>
>> AFAICS, an x86 FBSD gdb should support hardware breakpoints and
>> watchpoints.  I don't see an x64_64/amd64 FreeBSD port in the FSF GDB
>> tree, so it may be your GDB has local changes to support it
>> that missed adding the HW breakpoint support.
>
> Actually, that's nonsense.  There's an x86_64-freebsd port in mainline
> indeed.   But, it doesn't seem to install the necessary hooks for
> hardware breakpoints or watchpoints support.  Don't know
> more than that though.  And I didn't check older gdb's either.
>
> --
> Pedro Alves
>