X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EmbeddedPkg%2FLibrary%2FGdbDebugAgent%2FIa32%2FProcessor.c;h=96a1a596f3aeb9a5441013aa5bbafc2515fbc342;hp=d81e70f959c79a5c3c089fd1d1ca20988950f6e9;hb=685f8c760077cb2fb11b74c5758a6d54aebf539f;hpb=969eba7b0df70c9aa261eaf005085568b88de87c diff --git a/EmbeddedPkg/Library/GdbDebugAgent/Ia32/Processor.c b/EmbeddedPkg/Library/GdbDebugAgent/Ia32/Processor.c index d81e70f959..96a1a596f3 100755 --- a/EmbeddedPkg/Library/GdbDebugAgent/Ia32/Processor.c +++ b/EmbeddedPkg/Library/GdbDebugAgent/Ia32/Processor.c @@ -1,9 +1,9 @@ /** @file Processor specific parts of the GDB stub - Copyright (c) 2008-2009, Apple Inc. All rights reserved. + Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- All rights reserved. This program and the accompanying materials + This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -915,19 +915,37 @@ RemoveBreakPoint ( /** Initialize debug agent. - This function is used to set up debug enviroment. It may enable interrupts. + This function is used to set up debug environment to support source level debugging. + If certain Debug Agent Library instance has to save some private data in the stack, + this function must work on the mode that doesn't return to the caller, then + the caller needs to wrap up all rest of logic after InitializeDebugAgent() into one + function and pass it into InitializeDebugAgent(). InitializeDebugAgent() is + responsible to invoke the passing-in function at the end of InitializeDebugAgent(). - @param[in] InitFlag Init flag is used to decide initialize process. - @param[in] Context Context needed according to InitFlag, it was optional. + If the parameter Function is not NULL, Debug Agent Libary instance will invoke it by + passing in the Context to be its parameter. + + If Function() is NULL, Debug Agent Library instance will return after setup debug + environment. + + @param[in] InitFlag Init flag is used to decide the initialize process. + @param[in] Context Context needed according to InitFlag; it was optional. + @param[in] Function Continue function called by debug agent library; it was + optional. **/ VOID EFIAPI InitializeDebugAgent ( IN UINT32 InitFlag, - IN VOID *Context OPTIONAL + IN VOID *Context, OPTIONAL + IN DEBUG_AGENT_CONTINUE Function OPTIONAL ) { // BugBug: Add the code to build an GDT/IDT + + if (Function != NULL) { + Function (Context); + } }