Discussion:
disable debugger on specific Methods
Trivalik Trivalik
2012-02-26 21:34:33 UTC
Permalink
It would be nice to have a project specific dialog/page where we could add easy the method in a specific class which should not allowed for debug, and increase the speed.

An other approch would be to set classes in project which should debugable.

What do you think such thing to implement in the properites of cosmos project file.
Sebastian Schocke
2012-02-27 03:56:00 UTC
Permalink
We already have this now Trivalik. It's called the DebugStub attribute.

My memory is a bit hazy right now about the exact usage and location, due to the 2 week holiday, but check out MemoryBlock.cs and ManagedMemoryBlocks.cs for usage of it.

Not a dialog or page, but you can mark a Method in code as not debugable. Already helping a bucket load to make TCP stack much faster.

----- Original Message -----
From: "Trivalik Trivalik" <trivalik-/***@public.gmane.org>
To: Cosmos-Dev-***@public.gmane.org
Sent: Sunday, February 26, 2012 11:34:33 PM
Subject: [Cosmos-Dev] disable debugger on specific Methods






It would be nice to have a project specific dialog/page where we could add easy the method in a specific class which should not allowed for debug, and increase the speed.

An other approch would be to set classes in project which should debugable.

What do you think such thing to implement in the properites of cosmos project file.
Trivalik Trivalik
2012-02-27 20:04:12 UTC
Permalink
I know about this, but it is not really flexible.
It needs recompilation.

The approch for me is, should this do the debugger in the cosmos OS, through replace Int3 with NOP. The address should be known by ours VS debugger. This is done with a new dbg command which sets NOP or Int3 on places.

Or we do the lame Int3 remove in asm code. This is a little bit speed up.

The the current asm file with near no code in Kernel class contains 2700 Int3 mnemorics, so is not so many in relation to 284000 lines.
So I would prefer first one.
Post by Sebastian Schocke
We already have this now Trivalik. It's called the DebugStub attribute.
My memory is a bit hazy right now about the exact usage and location, due to the 2 week holiday, but check out MemoryBlock.cs and ManagedMemoryBlocks.cs for usage of it.
Not a dialog or page, but you can mark a Method in code as not debugable. Already helping a bucket load to make TCP stack much faster.
----- Original Message -----
Sent: Sunday, February 26, 2012 11:34:33 PM
Subject: [Cosmos-Dev] disable debugger on specific Methods
It would be nice to have a project specific dialog/page where we could add easy the method in a specific class which should not allowed for debug, and increase the speed.
An other approch would be to set classes in project which should debugable.
What do you think such thing to implement in the properites of cosmos project file.
Sebastian Schocke
2012-02-28 04:45:06 UTC
Permalink
I fail to see how you can get past the recompilation issue. Either the calls to int3 exist in the asm code before running NASM, or they don't.

Also, I fail to see how this can be made more flexible... you can turn the DebugStub on/off for any specific method independently, or using the project page disable the functionality of the attribute completely when needed.

If you can find a fast way to replace INT3 calls with NOP calls during runtime in memory, without needing to call back to the debugger, I could see an alternative, but even then changing opcodes in a running program is considered bad bad bad.

Somebody clear this up for me if I don't understand it correctly...

----- Original Message -----
From: "Trivalik Trivalik" <trivalik-/***@public.gmane.org>
To: Cosmos-Dev-***@public.gmane.org
Sent: Monday, February 27, 2012 10:04:12 PM
Subject: [Cosmos-Dev] Re: disable debugger on specific Methods






I know about this, but it is not really flexible.
It needs recompilation.

The approch for me is, should this do the debugger in the cosmos OS, through replace Int3 with NOP. The address should be known by ours VS debugger. This is done with a new dbg command which sets NOP or Int3 on places.

Or we do the lame Int3 remove in asm code. This is a little bit speed up.

The the current asm file with near no code in Kernel class contains 2700 Int3 mnemorics, so is not so many in relation to 284000 lines.
So I would prefer first one.
Post by Sebastian Schocke
We already have this now Trivalik. It's called the DebugStub attribute.
My memory is a bit hazy right now about the exact usage and location, due to the 2 week holiday, but check out MemoryBlock.cs and ManagedMemoryBlocks.cs for usage of it.
Not a dialog or page, but you can mark a Method in code as not debugable. Already helping a bucket load to make TCP stack much faster.
----- Original Message -----
Sent: Sunday, February 26, 2012 11:34:33 PM
Subject: [Cosmos-Dev] disable debugger on specific Methods
It would be nice to have a project specific dialog/page where we could add easy the method in a specific class which should not allowed for debug, and increase the speed.
An other approch would be to set classes in project which should debugable.
What do you think such thing to implement in the properites of cosmos project file.
Matthijs ter Woord
2012-02-28 08:32:54 UTC
Permalink
Fast way wont happen: you'd need a full list of memory locations to the
INT3 calls...
Post by Sebastian Schocke
I fail to see how you can get past the recompilation issue. Either the
calls to int3 exist in the asm code before running NASM, or they don't.
Also, I fail to see how this can be made more flexible... you can turn the
DebugStub on/off for any specific method independently, or using the
project page disable the functionality of the attribute completely when
needed.
If you can find a fast way to replace INT3 calls with NOP calls during
runtime in memory, without needing to call back to the debugger, I could
see an alternative, but even then changing opcodes in a running program is
considered bad bad bad.
Somebody clear this up for me if I don't understand it correctly...
----- Original Message -----
Sent: Monday, February 27, 2012 10:04:12 PM
Subject: [Cosmos-Dev] Re: disable debugger on specific Methods
I know about this, but it is not really flexible.
It needs recompilation.
The approch for me is, should this do the debugger in the cosmos OS,
through replace Int3 with NOP. The address should be known by ours VS
debugger. This is done with a new dbg command which sets NOP or Int3 on
places.
Or we do the lame Int3 remove in asm code. This is a little bit speed up.
The the current asm file with near no code in Kernel class contains 2700
Int3 mnemorics, so is not so many in relation to 284000 lines.
So I would prefer first one.
Post by Sebastian Schocke
We already have this now Trivalik. It's called the DebugStub attribute.
My memory is a bit hazy right now about the exact usage and location,
due to the 2 week holiday, but check out MemoryBlock.cs and
ManagedMemoryBlocks.cs for usage of it.
Post by Sebastian Schocke
Not a dialog or page, but you can mark a Method in code as not
debugable. Already helping a bucket load to make TCP stack much faster.
Post by Sebastian Schocke
----- Original Message -----
Sent: Sunday, February 26, 2012 11:34:33 PM
Subject: [Cosmos-Dev] disable debugger on specific Methods
It would be nice to have a project specific dialog/page where we could
add easy the method in a specific class which should not allowed for debug,
and increase the speed.
Post by Sebastian Schocke
An other approch would be to set classes in project which should
debugable.
Post by Sebastian Schocke
What do you think such thing to implement in the properites of cosmos
project file.
------------------------------------
--------------------------------------------------
More things to join for Cosmos!
http://tinyurl.com/pc7bds
http://tinyurl.com/qhttde
http://tinyurl.com/plrloa
--------------------------------------------------
Yahoo! Groups Links
Chad Hower aka Kudzu
2012-02-28 13:23:46 UTC
Permalink
Post by Matthijs ter Woord
Fast way wont happen: you'd need a full list of memory locations to the
INT3 calls...
Unless someone wants to write a bin parser.. yuck.. :(
Matthijs ter Woord
2012-02-28 13:24:24 UTC
Permalink
you cant: as the kernel doesn't know what's code and what's data...
Post by Chad Hower aka Kudzu
Post by Matthijs ter Woord
Fast way wont happen: you'd need a full list of memory locations to the
INT3 calls...
Unless someone wants to write a bin parser.. yuck.. :(
------------------------------------
--------------------------------------------------
More things to join for Cosmos!
http://tinyurl.com/pc7bds
http://tinyurl.com/qhttde
http://tinyurl.com/plrloa
--------------------------------------------------
Yahoo! Groups Links
Chad Hower aka Kudzu
2012-02-28 13:23:08 UTC
Permalink
Post by Sebastian Schocke
see an alternative, but even then changing opcodes in a running program
is considered bad bad bad.
For normal programs yes it is bad and the CPU can even enforce it.
However for debuggers it is a fine practice.
Trivalik Trivalik
2012-02-28 16:56:40 UTC
Permalink
If this is a green light, then I would try to start in my local session, and provide in future a devkit setup to test for you.
Post by Chad Hower aka Kudzu
Post by Sebastian Schocke
see an alternative, but even then changing opcodes in a running program
is considered bad bad bad.
For normal programs yes it is bad and the CPU can even enforce it.
However for debuggers it is a fine practice.
Chad Z. Hower aka Kudzu
2012-02-28 21:45:29 UTC
Permalink
Post by Trivalik Trivalik
If this is a green light, then I would try to start in my local session,
and provide in future a devkit setup to test for you.
I missed the early part of the thread - what do you want to do thats
different than the attrib we have now?
Trivalik Trivalik
2012-02-28 21:52:25 UTC
Permalink
Add an entry in properties of project which include the functions / class which should not debugable. This will be done by Int3 replacement through a Debugger Command which is send to CosmOS on serial. This is hotplugable in both direction, enable and disable. Not static as our attribute.
Post by Chad Z. Hower aka Kudzu
Post by Trivalik Trivalik
If this is a green light, then I would try to start in my local session,
and provide in future a devkit setup to test for you.
I missed the early part of the thread - what do you want to do thats
different than the attrib we have now?
Matthijs ter Woord
2012-02-29 08:20:58 UTC
Permalink
ok, but if you set it project wide, why not do it compiletime? (ie, leave
out the nop also)
Post by Trivalik Trivalik
Add an entry in properties of project which include the functions / class
which should not debugable. This will be done by Int3 replacement through a
Debugger Command which is send to CosmOS on serial. This is hotplugable in
both direction, enable and disable. Not static as our attribute.
Post by Chad Z. Hower aka Kudzu
Post by Trivalik Trivalik
If this is a green light, then I would try to start in my local
session,
Post by Chad Z. Hower aka Kudzu
Post by Trivalik Trivalik
and provide in future a devkit setup to test for you.
I missed the early part of the thread - what do you want to do thats
different than the attrib we have now?
------------------------------------
--------------------------------------------------
More things to join for Cosmos!
http://tinyurl.com/pc7bds
http://tinyurl.com/qhttde
http://tinyurl.com/plrloa
--------------------------------------------------
Yahoo! Groups Links
Trivalik Trivalik
2012-02-29 13:07:01 UTC
Permalink
Me is the degree of dynamic important. We could also add a checkbox for static non debugable, like it is in attribute case.
Post by Matthijs ter Woord
ok, but if you set it project wide, why not do it compiletime? (ie, leave
out the nop also)
Post by Trivalik Trivalik
Add an entry in properties of project which include the functions / class
which should not debugable. This will be done by Int3 replacement through a
Debugger Command which is send to CosmOS on serial. This is hotplugable in
both direction, enable and disable. Not static as our attribute.
Post by Chad Z. Hower aka Kudzu
Post by Trivalik Trivalik
If this is a green light, then I would try to start in my local
session,
Post by Chad Z. Hower aka Kudzu
Post by Trivalik Trivalik
and provide in future a devkit setup to test for you.
I missed the early part of the thread - what do you want to do thats
different than the attrib we have now?
------------------------------------
--------------------------------------------------
More things to join for Cosmos!
http://tinyurl.com/pc7bds
http://tinyurl.com/qhttde
http://tinyurl.com/plrloa
--------------------------------------------------
Yahoo! Groups Links
Loading...