Re: [ros-dev] [ros-diffs] [tkreuzer] 64078: [PSEH] - On clang builds we need to do the return twice trick, since we don't have asm goto, which would allow us to specify labels in the code where we can
On 2014-09-07 23:40, tkreu...@svn.reactos.org wrote: --- trunk/reactos/lib/pseh/i386/pseh3_i386.S [iso-8859-1] (original) +++ trunk/reactos/lib/pseh/i386/pseh3_i386.S [iso-8859-1] Sun Sep 7 21:40:07 2014 @@ -30,6 +30,10 @@ mov [eax + SEH3_REGISTRATION_FRAME_Esi], esi mov [eax + SEH3_REGISTRATION_FRAME_Edi], edi +/* Safe the return address */ +mov ebx, [esp] +mov [eax + SEH3_REGISTRATION_FRAME_ReturnAddress], ebx + .global __SEH3$_RegisterFrameWithStackLayout __SEH3$_RegisterFrameWithStackLayout: I think we need to restore ebx before returning? I don't see us telling the compiler that it was clobbered anywhere. ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [jgardou] 64121: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permit
Awesome, indeed! Any info or tuto about how to use it? About how to plug GDB to it? Cheers, On 09/12/2014 12:57 AM, Timo Kreuzer wrote: Awesome stuff! Am 11.09.2014 22:55, schrieb jgar...@svn.reactos.org: Author: jgardou Date: Thu Sep 11 20:55:42 2014 New Revision: 64121 URL: http://svn.reactos.org/svn/reactos?rev=64121view=rev Log: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permits source-level debugging in some modules. More will be added as I feel the need and find the time to work a bit more on it. (That is, unless an angel comes and resume the work) To use it, set GDB and _WINKD_ to TRUE in your CMakeCache.txt. Using separate debug symbols is also a good idea. ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev -- Pierre Schweitzer pie...@reactos.org System Network Administrator Senior Kernel Developer ReactOS Deutschland e.V. smime.p7s Description: S/MIME Cryptographic Signature ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [jgardou] 64121: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permit
Sure, I will write one as soon as it is functional, but to make it short, it is as simple as launching gdb and using target remote your_com_port On ReactOS side, /DEBUGPORT=COMx and you're ready to go. Enjoy Jérôme Le 12/09/2014 17:35, Pierre Schweitzer a écrit : Awesome, indeed! Any info or tuto about how to use it? About how to plug GDB to it? Cheers, On 09/12/2014 12:57 AM, Timo Kreuzer wrote: Awesome stuff! Am 11.09.2014 22:55, schrieb jgar...@svn.reactos.org: Author: jgardou Date: Thu Sep 11 20:55:42 2014 New Revision: 64121 URL: http://svn.reactos.org/svn/reactos?rev=64121view=rev Log: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permits source-level debugging in some modules. More will be added as I feel the need and find the time to work a bit more on it. (That is, unless an angel comes and resume the work) To use it, set GDB and _WINKD_ to TRUE in your CMakeCache.txt. Using separate debug symbols is also a good idea. ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [jgardou] 64121: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permit
And what about this GDB stub there: trunk/reactos/ntoskrnl/kd/wrappers/ ? Do we still need it? Hermès. De : Ros-dev [mailto:ros-dev-boun...@reactos.org] De la part de Jérôme Gardou Envoyé : vendredi 12 septembre 2014 18:20 À : ros-dev@reactos.org Objet : Re: [ros-dev] [ros-diffs] [jgardou] 64121: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permits source-level debuggin... Sure, I will write one as soon as it is functional, but to make it short, it is as simple as launching gdb and using target remote your_com_port On ReactOS side, /DEBUGPORT=COMx and you're ready to go. Enjoy Jérôme Le 12/09/2014 17:35, Pierre Schweitzer a écrit : Awesome, indeed! Any info or tuto about how to use it? About how to plug GDB to it? Cheers, On 09/12/2014 12:57 AM, Timo Kreuzer wrote: Awesome stuff! Am 11.09.2014 22:55, schrieb jgar...@svn.reactos.org: Author: jgardou Date: Thu Sep 11 20:55:42 2014 New Revision: 64121 URL: http://svn.reactos.org/svn/reactos?rev=64121 http://svn.reactos.org/svn/reactos?rev=64121view=rev view=rev Log: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permits source-level debugging in some modules. More will be added as I feel the need and find the time to work a bit more on it. (That is, unless an angel comes and resume the work) To use it, set GDB and _WINKD_ to TRUE in your CMakeCache.txt. Using separate debug symbols is also a good idea. ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [jgardou] 64121: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permit
Ah and I forgot : Jérôme, now you can use /DEBUGPORT=foo to load KDfoo.DLL ;) Then your KDfoo.DLL can implement a simple line parser in order to interpret any other hypothetical parameters present in the bootloader command line (some other KDxxx use that, for example KD1394 or KDUSB iirc.). One can imagine something like: /DEBUGPORT=GDB:COM1 to say: Load KDGDB.DLL and use COM1 for it. Currently its not what you did, maybe it would be great to have that? (and using /DEBUGPORT=COM1 just for loading KDCOM.DLL, the KD layer for WinDbg ?) Hermès. De : Ros-dev [mailto:ros-dev-boun...@reactos.org] De la part de Jérôme Gardou Envoyé : vendredi 12 septembre 2014 18:20 À : ros-dev@reactos.org Objet : Re: [ros-dev] [ros-diffs] [jgardou] 64121: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permits source-level debuggin... Sure, I will write one as soon as it is functional, but to make it short, it is as simple as launching gdb and using target remote your_com_port On ReactOS side, /DEBUGPORT=COMx and you're ready to go. Enjoy Jérôme Le 12/09/2014 17:35, Pierre Schweitzer a écrit : Awesome, indeed! Any info or tuto about how to use it? About how to plug GDB to it? Cheers, On 09/12/2014 12:57 AM, Timo Kreuzer wrote: Awesome stuff! Am 11.09.2014 22:55, schrieb jgar...@svn.reactos.org: Author: jgardou Date: Thu Sep 11 20:55:42 2014 New Revision: 64121 URL: http://svn.reactos.org/svn/reactos?rev=64121 http://svn.reactos.org/svn/reactos?rev=64121view=rev view=rev Log: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permits source-level debugging in some modules. More will be added as I feel the need and find the time to work a bit more on it. (That is, unless an angel comes and resume the work) To use it, set GDB and _WINKD_ to TRUE in your CMakeCache.txt. Using separate debug symbols is also a good idea. ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [jgardou] 64121: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permit
I thought about that, but considering the fact that using windbg for a GCC compiled OS or GDB for a MSVC compiled OS makes little sense (although one could use that for mixed kernel+drivers setup), I decided to go the KDCOM way. I am open to good arguments for doing that another way though. Jérôme Le 12/09/2014 18:42, Hermès BÉLUSCA - MAÏTO a écrit : Ah and I forgot : Jérôme, now you can use /DEBUGPORT=foo to load KDfoo.DLL ;) Then your KDfoo.DLL can implement a simple line parser in order to interpret any other hypothetical parameters present in the bootloader command line (some other KDxxx use that, for example KD1394 or KDUSB iirc.). One can imagine something like: /DEBUGPORT=GDB:COM1 to say: “Load KDGDB.DLL and use COM1 for it”. Currently it’s not what you did, maybe it would be great to have that? (and using /DEBUGPORT=COM1 just for loading KDCOM.DLL, the KD layer for WinDbg ?) Hermès. *De :*Ros-dev [mailto:ros-dev-boun...@reactos.org] *De la part de* Jérôme Gardou *Envoyé :* vendredi 12 septembre 2014 18:20 *À :* ros-dev@reactos.org *Objet :* Re: [ros-dev] [ros-diffs] [jgardou] 64121: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permits source-level debuggin... Sure, I will write one as soon as it is functional, but to make it short, it is as simple as launching gdb and using target remote your_com_port On ReactOS side, /DEBUGPORT=COMx and you're ready to go. Enjoy Jérôme Le 12/09/2014 17:35, Pierre Schweitzer a écrit : Awesome, indeed! Any info or tuto about how to use it? About how to plug GDB to it? Cheers, On 09/12/2014 12:57 AM, Timo Kreuzer wrote: Awesome stuff! Am 11.09.2014 22:55, schriebjgar...@svn.reactos.org mailto:jgar...@svn.reactos.org: Author: jgardou Date: Thu Sep 11 20:55:42 2014 New Revision: 64121 URL:http://svn.reactos.org/svn/reactos?rev=64121view=rev Log: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permits source-level debugging in some modules. More will be added as I feel the need and find the time to work a bit more on it. (That is, unless an angel comes and resume the work) To use it, set GDB and _WINKD_ to TRUE in your CMakeCache.txt. Using separate debug symbols is also a good idea. ___ Ros-dev mailing list Ros-dev@reactos.org mailto:Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org mailto:Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [jgardou] 64121: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permit
This will go away eventually. Le 12/09/2014 18:40, Hermès BÉLUSCA - MAÏTO a écrit : And what about this GDB stub there: trunk/reactos/ntoskrnl/kd/wrappers/ ? Do we still need it? Hermès. *De :*Ros-dev [mailto:ros-dev-boun...@reactos.org] *De la part de* Jérôme Gardou *Envoyé :* vendredi 12 septembre 2014 18:20 *À :* ros-dev@reactos.org *Objet :* Re: [ros-dev] [ros-diffs] [jgardou] 64121: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permits source-level debuggin... Sure, I will write one as soon as it is functional, but to make it short, it is as simple as launching gdb and using target remote your_com_port On ReactOS side, /DEBUGPORT=COMx and you're ready to go. Enjoy Jérôme Le 12/09/2014 17:35, Pierre Schweitzer a écrit : Awesome, indeed! Any info or tuto about how to use it? About how to plug GDB to it? Cheers, On 09/12/2014 12:57 AM, Timo Kreuzer wrote: Awesome stuff! Am 11.09.2014 22:55, schriebjgar...@svn.reactos.org mailto:jgar...@svn.reactos.org: Author: jgardou Date: Thu Sep 11 20:55:42 2014 New Revision: 64121 URL:http://svn.reactos.org/svn/reactos?rev=64121view=rev Log: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permits source-level debugging in some modules. More will be added as I feel the need and find the time to work a bit more on it. (That is, unless an angel comes and resume the work) To use it, set GDB and _WINKD_ to TRUE in your CMakeCache.txt. Using separate debug symbols is also a good idea. ___ Ros-dev mailing list Ros-dev@reactos.org mailto:Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org mailto:Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [jgardou] 64127: [KDGDB] - Add a callback mechanism permitting to simulate KD send - receive loop without having to actually communicate to GDB - Use that to update the p
while(1); is not really a good solution. It should be something that is visible in GDB. But I fear that a KeBugCheck() won't work here, since it will rely on a working KD connection. Maybe a KD_ASSERT() macro, that calls KdAssert() on failure or something, resets the GDB connection somehow, issues a debug print and then halts. Am 12.09.2014 22:23, schrieb jgar...@svn.reactos.org: Author: jgardou Date: Fri Sep 12 20:23:08 2014 New Revision: 64127 URL: http://svn.reactos.org/svn/reactos?rev=64127view=rev Log: [KDGDB] - Add a callback mechanism permitting to simulate KD send - receive loop without having to actually communicate to GDB - Use that to update the program counter when cont'ing a breakpoint Now cont'ing an assertion failure is possible, since we actually get beyond the int 3 instruction Modified: trunk/reactos/drivers/base/kdgdb/gdb_input.c trunk/reactos/drivers/base/kdgdb/kdgdb.h trunk/reactos/drivers/base/kdgdb/kdpacket.c +) +{ +DBGKD_MANIPULATE_STATE64* State = (DBGKD_MANIPULATE_STATE64*)MessageHeader-Buffer; + +/* We just confirm that all went well */ +if ((PacketType != PACKET_TYPE_KD_STATE_MANIPULATE) +|| (State-ApiNumber != DbgKdSetContextApi) +|| (State-ReturnStatus != STATUS_SUCCESS)) +{ +/* Should we bugcheck ? */ +while (1); +} +} + +static +KDSTATUS +SetContext( +_Out_ DBGKD_MANIPULATE_STATE64* State, +_Out_ PSTRING MessageData, +_Out_ PULONG MessageLength, +_Inout_ PKD_CONTEXT KdContext, +_In_opt_ KDP_MANIPULATESTATE_HANDLER ManipulateStateHandler +) +{ +State-ApiNumber = DbgKdSetContextApi; +State-Processor = CurrentStateChange.Processor; +State-ReturnStatus = STATUS_SUCCESS; +State-ProcessorLevel = CurrentStateChange.ProcessorLevel; +MessageData-Length = sizeof(CurrentContext); + +if (MessageData-MaximumLength sizeof(CurrentContext)) +{ +while (1); +} + ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [jgardou] 64127: [KDGDB] - Add a callback mechanism permitting to simulate KD send - receive loop without having to actually communicate to GDB - Use that to update the p
Yeah you're not the first one to tell me that, and I wasn't really happy to write it either. I like your approach. I will try to do as you suggest. Thanks Jérôme Le 12/09/2014 22:53, Timo Kreuzer a écrit : while(1); is not really a good solution. It should be something that is visible in GDB. But I fear that a KeBugCheck() won't work here, since it will rely on a working KD connection. Maybe a KD_ASSERT() macro, that calls KdAssert() on failure or something, resets the GDB connection somehow, issues a debug print and then halts. Am 12.09.2014 22:23, schrieb jgar...@svn.reactos.org: Author: jgardou Date: Fri Sep 12 20:23:08 2014 New Revision: 64127 URL: http://svn.reactos.org/svn/reactos?rev=64127view=rev Log: [KDGDB] - Add a callback mechanism permitting to simulate KD send - receive loop without having to actually communicate to GDB - Use that to update the program counter when cont'ing a breakpoint Now cont'ing an assertion failure is possible, since we actually get beyond the int 3 instruction Modified: trunk/reactos/drivers/base/kdgdb/gdb_input.c trunk/reactos/drivers/base/kdgdb/kdgdb.h trunk/reactos/drivers/base/kdgdb/kdpacket.c +) +{ +DBGKD_MANIPULATE_STATE64* State = (DBGKD_MANIPULATE_STATE64*)MessageHeader-Buffer; + +/* We just confirm that all went well */ +if ((PacketType != PACKET_TYPE_KD_STATE_MANIPULATE) +|| (State-ApiNumber != DbgKdSetContextApi) +|| (State-ReturnStatus != STATUS_SUCCESS)) +{ +/* Should we bugcheck ? */ +while (1); +} +} + +static +KDSTATUS +SetContext( +_Out_ DBGKD_MANIPULATE_STATE64* State, +_Out_ PSTRING MessageData, +_Out_ PULONG MessageLength, +_Inout_ PKD_CONTEXT KdContext, +_In_opt_ KDP_MANIPULATESTATE_HANDLER ManipulateStateHandler +) +{ +State-ApiNumber = DbgKdSetContextApi; +State-Processor = CurrentStateChange.Processor; +State-ReturnStatus = STATUS_SUCCESS; +State-ProcessorLevel = CurrentStateChange.ProcessorLevel; +MessageData-Length = sizeof(CurrentContext); + +if (MessageData-MaximumLength sizeof(CurrentContext)) +{ +while (1); +} + ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [jgardou] 64121: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permit
Absolutely great stuff! And does it work in Windows? :-) (not that there is so much demand in that, just for fun) Regards, Aleksey On 12.09.2014 19:35, Pierre Schweitzer wrote: Awesome, indeed! Any info or tuto about how to use it? About how to plug GDB to it? Cheers, On 09/12/2014 12:57 AM, Timo Kreuzer wrote: Awesome stuff! Am 11.09.2014 22:55, schrieb jgar...@svn.reactos.org: Author: jgardou Date: Thu Sep 11 20:55:42 2014 New Revision: 64121 URL: http://svn.reactos.org/svn/reactos?rev=64121view=rev Log: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permits source-level debugging in some modules. More will be added as I feel the need and find the time to work a bit more on it. (That is, unless an angel comes and resume the work) To use it, set GDB and _WINKD_ to TRUE in your CMakeCache.txt. Using separate debug symbols is also a good idea. ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [jgardou] 64121: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permit
I guess so, I didn't try. But feel free to do! :-p Regards Jérôme Le 12/09/2014 23:25, Aleksey Bragin a écrit : Absolutely great stuff! And does it work in Windows? :-) (not that there is so much demand in that, just for fun) Regards, Aleksey On 12.09.2014 19:35, Pierre Schweitzer wrote: Awesome, indeed! Any info or tuto about how to use it? About how to plug GDB to it? Cheers, On 09/12/2014 12:57 AM, Timo Kreuzer wrote: Awesome stuff! Am 11.09.2014 22:55, schrieb jgar...@svn.reactos.org: Author: jgardou Date: Thu Sep 11 20:55:42 2014 New Revision: 64121 URL: http://svn.reactos.org/svn/reactos?rev=64121view=rev Log: [KDGDB] - introduce KDGDB, a KDCOM-like DLL, wrapping the KD protocol and the GDB remote protocol together. It is not fully functional, but for now it permits source-level debugging in some modules. More will be added as I feel the need and find the time to work a bit more on it. (That is, unless an angel comes and resume the work) To use it, set GDB and _WINKD_ to TRUE in your CMakeCache.txt. Using separate debug symbols is also a good idea. ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev