flat assembler
Message board for the users of flat assembler.

Index > Main > debug doesnt work

Author
Thread Post new topic Reply to topic
a115433



Joined: 05 Mar 2010
Posts: 144
a115433 26 Apr 2010, 07:34
code is in protected nonpaged mode:
Code:
mov eax,dbb
mov dr0,eax


mov eax,dr7
bts eax,1 ;global enable

btr eax,16 ;execution
btr eax,17 ;


btr eax,18 ;length 1
btr eax,19 ;
mov dr7,eax



dbb: jmp $    


doesnt work.
why? jmp $ is executed without debug exception.
when i change r/w and length effect is same, debug do not happen.
trap flag works fine.[/code]
Post 26 Apr 2010, 07:34
View user's profile Send private message Reply with quote
a115433



Joined: 05 Mar 2010
Posts: 144
a115433 26 Apr 2010, 19:50
ok it DOESNT work, and i have no clue whats wrong with it.
like its ignored! maybe i have to set some flags in CRX/MSR???
Post 26 Apr 2010, 19:50
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20621
Location: In your JS exploiting you and your system
revolution 26 Apr 2010, 21:12
One minute reading the doc would have saved you eight hours of needless effort.

Intel doc:
MOV—Move to/from Debug Registers wrote:
#GP(0) If the current privilege level is not 0.
#DB If any debug register is accessed while the DR7.GD[bit 13] = 1.
Post 26 Apr 2010, 21:12
View user's profile Send private message Visit poster's website Reply with quote
a115433



Joined: 05 Mar 2010
Posts: 144
a115433 27 Apr 2010, 06:30
Quote:
#GP(0) If the current privilege level is not 0.
#DB If any debug register is accessed while the DR7.GD[bit 13] = 1.

im in cpl = 0
and this bit is clear.

im not getting any interrupt, its just ignoring it.
and yes, all drs are successfully set. breakpoint instead of triggering int 1 is IGNORED.
Post 27 Apr 2010, 06:30
View user's profile Send private message Reply with quote
a115433



Joined: 05 Mar 2010
Posts: 144
a115433 28 Apr 2010, 08:54
Code:
pm_start:


mov ax,0x10
mov ds,ax



mov ecx,dr7

mov eax,dbb
mov dr0,eax


mov eax,dr7
bts eax,1

bts eax,9



bts eax,16
bts eax,17


bts eax,18
bts eax,19

mov dr7,eax


mov dword eax,[dbb]
mov dword [dbb],eax



jmp $

align 4
dbb dd 0    


it DOES NOT work.
im doing everything exactly as written in manual, and it doesnt work!
jmp $ is executed instead of error indicating lack of idt vector (wich happens with trap flag, or GD bit).
Post 28 Apr 2010, 08:54
View user's profile Send private message Reply with quote
a115433



Joined: 05 Mar 2010
Posts: 144
a115433 28 Apr 2010, 09:37
--enable-x86-debugger no X86 debugger support. If the software you run in bochs needs to use the x86 hardware debugging facilities such as DR0..DR7, instruction and data breakpoints etc., then you should use this option. Otherwise don't use it, as it will slow down the emulation.



FUUUUUUUUUUUUUUUU
Post 28 Apr 2010, 09:37
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20621
Location: In your JS exploiting you and your system
revolution 28 Apr 2010, 09:39
Well if you had mentioned at the start that you were using bochs then the answer would have been easy.

bochs != real CPU or mobo
Post 28 Apr 2010, 09:39
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.