Is that possible to set breakpoint for changing-register?


When I debug the loading process of my OS image, I found that when it
hanged,
the editor window shows that the address is 00000000, where the asm code is
???
(unknown or inaccessible ). So I suspect that something was wrong to change
the
PC (Program Count register) value to zero!

So I want to see WHO does it. Is it possible to set a breakpoint to monitor
the PC value, if it change to zero, then break. (The data breakpoint seem
for
expression in c-level). Or is there any useful method to solve this problem?

Thanks a lot!

Re: Is that possible to set breakpoint for changing-register? by olol

olol
Sun Oct 24 02:39:43 CDT 2004


"olol" <coocoo@citiz.net> wrote in message
news:OpMs2vZuEHA.4040@TK2MSFTNGP09.phx.gbl...
> Is that possible to set breakpoint for changing-register?
>
>
> When I debug the loading process of my OS image, I found that when it
> hanged,
> the editor window shows that the address is 00000000, where the asm code
> is
~~~~~~~~~~~~~~~
It means "Disassembly window" -- who indicate the current executing thread,
I think?

> ???
> (unknown or inaccessible ). So I suspect that something was wrong to
> change the
> PC (Program Count register) value to zero!
>
> So I want to see WHO does it. Is it possible to set a breakpoint to
> monitor
> the PC value, if it change to zero, then break. (The data breakpoint seem
> for
> expression in c-level). Or is there any useful method to solve this
> problem?
>
> Thanks a lot!
>



Re: Is that possible to set breakpoint for changing-register? by mlarsen

mlarsen
Wed Nov 10 12:43:31 CST 2004

You are correct, some program is jumping to location 000000. This typically
happens when you are calling a function using a pointer, but the pointer
has not been initialized.

The best way to figure this out is to look at the stack pointer, then look
at all the DWORDs on the stack. One of them will be a return address. This
will give you the next instruction in the function that just called the one
that caused the problem. By looking at the previous instruction you should
see a call to the function that caused the problem.

It will be easier to track this down in debug build of the code, since the
retail code does not always put the return address on the stack.

Mark Larsen
--------------------
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "olol" <coocoo@citiz.net>
| References: <OpMs2vZuEHA.4040@TK2MSFTNGP09.phx.gbl>
| Subject: Re: Is that possible to set breakpoint for changing-register?
| Date: Sun, 24 Oct 2004 15:39:43 +0800
| Lines: 30
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Response
| Message-ID: <OKxniyZuEHA.908@TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.windowsce.platbuilder
| NNTP-Posting-Host: tide74.microsoft.com 131.107.71.226
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.windowsce.platbuilder:56864
| X-Tomcat-NG: microsoft.public.windowsce.platbuilder
|
|
| "olol" <coocoo@citiz.net> wrote in message
| news:OpMs2vZuEHA.4040@TK2MSFTNGP09.phx.gbl...
| > Is that possible to set breakpoint for changing-register?
| >
| >
| > When I debug the loading process of my OS image, I found that when it
| > hanged,
| > the editor window shows that the address is 00000000, where the asm
code
| > is
| ~~~~~~~~~~~~~~~
| It means "Disassembly window" -- who indicate the current executing
thread,
| I think?
|
| > ???
| > (unknown or inaccessible ). So I suspect that something was wrong to
| > change the
| > PC (Program Count register) value to zero!
| >
| > So I want to see WHO does it. Is it possible to set a breakpoint to
| > monitor
| > the PC value, if it change to zero, then break. (The data breakpoint
seem
| > for
| > expression in c-level). Or is there any useful method to solve this
| > problem?
| >
| > Thanks a lot!
| >
|
|
|