Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > C++ Builder
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 28-03-2014
Avatar de aguml
aguml aguml is offline
Miembro
 
Registrado: may 2013
Posts: 885
Poder: 14
aguml Va por buen camino
Pues acabo de probar lo siguiente.

En el constructor del hilo he puesto esto:
Código:
__fastcall THiloDebugger(bool CreateSuspended, STARTUPINFO *startupInfo, TList *ListBPs, AnsiString Path, PROCESS_INFORMATION *processInfo, CONTEXT *context, DWORD *LastExcepAddress, TDebugger *Debugger);
El ultimo parametro es un puntero al objeto de tipo TDebugger que se crea.

En el protected del THiloDebugger he añadido esto:
Código:
TDebugger *Dbg;
Y en el constructor añado esto:
Código:
Dbg = Debugger;
En el TDebugger hago esto:
Código:
HiloDbg = new THiloDebugger(true, &si, ListaBPs, PathFile, &pi, &con, &LastExceptionAddress, this);
Y el miembro de THiloDebugger queda asi:
Código:
void __fastcall THiloDebugger::OnCreateThreadDebugEventThread()
{
        dwContinueStatus = Dbg->OnExitDebugEvent(&DebugEv);
}
Al intentar compilar me dice esto:
Código:
[C++ Error] THiloDebugger.cpp(217): E2316 'OnExitDebugEvent' is not a member of 'TDebugger'
OnExitDebugEvent está dentro del private de TDebugger. y por lo tanto no me deja acceder desde el objeto tipo TDebugger pero si me deja desde los metodos de TDebugger. ¿como lo hago?
Responder Con Cita
  #2  
Antiguo 29-03-2014
Avatar de aguml
aguml aguml is offline
Miembro
 
Registrado: may 2013
Posts: 885
Poder: 14
aguml Va por buen camino
Vale, esto ya compila y corre y lanza el depurador y solo me falta un detalle. He creado esto:

En el protected del THiloDebugger:
TEventDebugCallBack FuncEventos;

En el Execute:
Synchronize(GetFuncEvents);

Este es el metodo:
Código:
void __fastcall THiloDebugger::GetFuncEvents()
{
        Dbg->GetCallBack(&FuncEventos);
}

Y aqui en el TDebugger:
// Obtener los CallBacks

void TDebugger::GetOnSystemBreakPoint(SYSTEMBREAKPOINT func){
    func = FuncSystemBreakPoint;
}
//---------------------------------------------------------------------------

void TDebugger::GetOnBPs(BREAKPOINT func){
    func = FuncBPs;
}
//---------------------------------------------------------------------------

void TDebugger::GetOnSingleStep(SINGLESTEP func){
    func = FuncSingleStep;
}
//---------------------------------------------------------------------------

void TDebugger::GetOnException(EXCEPTION func){
    func = FuncException;
}
//---------------------------------------------------------------------------

void TDebugger::GetOnCreateProcess(CREATEPROCESS func){
    func = FuncCreateProcess;
}
//---------------------------------------------------------------------------

void TDebugger::GetOnExitProcess(EXITPROCESS func){
    func = FuncExitProcess;
}
//---------------------------------------------------------------------------

void TDebugger::GetOnCreateThread(CREATETHREAD func){
    func = FuncCreateThread;
}
//---------------------------------------------------------------------------

void TDebugger::GetOnExitThread(EXITTHREAD func){
    func = FuncExitThread;
}
//---------------------------------------------------------------------------

void TDebugger::GetOnLoadDll(LOADDLL func){
    func = FuncLoadDLL;
}
//---------------------------------------------------------------------------

void TDebugger::GetOnUnLoadDll(UNLOADDLL func){
    func = FuncUnLoadDLL;
}
//---------------------------------------------------------------------------

void TDebugger::GetOnOutPutString(OUTPUTSTRING func){
    func = FuncOutPutString;
}
//---------------------------------------------------------------------------

void TDebugger::GetOnRIP(RIP func){
    func = FuncRIP;
}
//---------------------------------------------------------------------------

void TDebugger::GetCallBack(TEventDebugCallBack *tEstruc){
    GetOnSystemBreakPoint(tEstruc->FuncSystemBreakPoint);
    GetOnBPs(tEstruc->FuncBPs);
    GetOnException(tEstruc->FuncException);
    GetOnCreateProcess(tEstruc->FuncCreateProcess);
    GetOnExitProcess(tEstruc->FuncExitProcess);
    GetOnCreateThread(tEstruc->FuncCreateThread);
    GetOnExitThread(tEstruc->FuncExitThread);
    GetOnLoadDll(tEstruc->FuncLoadDLL);
    GetOnUnLoadDll(tEstruc->FuncUnLoadDLL);
    GetOnOutPutString(tEstruc->FuncOutPutString);
    GetOnRIP(tEstruc->FuncRIP);
    GetOnSingleStep(tEstruc->FuncSingleStep);
}
El problema es el siguiente, no me guarda los punteros a las funciones en la estructura y eso que si pongo un breakpoint por ejemplo en GetOnSystemBreakPoint veo como le asigna correctamente {TFormPrincipal::OnSystemBreakPoint,:00A16EF0} al miembro de la estructura pero al salir de ese metodo me aparece ese miembro de la estructura como NULL,NULL y no se como solucionarlo ya que es lo ultimo que tengo que solucionar para que esto corra como quiero por ahora.

Última edición por ecfisa fecha: 29-03-2014 a las 01:26:54. Razón: Agregar etiquetas [code]
Responder Con Cita
  #3  
Antiguo 29-03-2014
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Poder: 38
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola aguml.

Por favor, no olvides usar las etiquetas [code] tu_codigo [/code] cuando pongas código C++ en el mensaje.

Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita
  #4  
Antiguo 29-03-2014
Avatar de aguml
aguml aguml is offline
Miembro
 
Registrado: may 2013
Posts: 885
Poder: 14
aguml Va por buen camino
perdon, me di cuenta tarde de que se me olvidó y lo intente editar pero mo me aparecia la opcion de encapsular al editarlo y no cai en hacerlo manualmente poniendo las etiquetas a mano.
Responder Con Cita
  #5  
Antiguo 31-03-2014
Avatar de aguml
aguml aguml is offline
Miembro
 
Registrado: may 2013
Posts: 885
Poder: 14
aguml Va por buen camino
Bueno al final lo he conseguido solucionar.
Gracias amigos.
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Problemas con hilos y remobjects Pascal Script. J.Slann Varios 4 19-11-2011 17:35:28
Problemas con acceso telefonico a redes e hilos ospaco69 OOP 0 08-08-2007 00:02:36
problemas con hilos (Thead) jmlifi Varios 2 20-03-2007 17:56:53
problemas con Hilos (Thread) jmlifi Varios 2 26-02-2007 15:29:21
Builder c++ 6 y los hilos javikanin C++ Builder 1 26-11-2004 14:49:10


La franja horaria es GMT +2. Ahora son las 19:21:39.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi