/**
Enable the plugin's intercepts.
@internalComponent
 */
void CStacked3Plugin::EnableInterceptsL()
	{
	if (iInterceptsEnabled) return;

	User::LeaveIfError(RegisterIntercept(EFsFileWrite, 		 	EPreIntercept));	

	_LOG(_L("Stacked3 Plugin: Enabled intercepts."));

	iInterceptsEnabled = ETrue;
	}
void CPreModifierPlugin::FsFileTempL(TFsPluginRequest& aRequest)
	{
	TBuf<256> testfilename1;

	//setting up test files
	testfilename1.Append(iDriveToTest);
	testfilename1.Append(_L(":\\Data\\"));

	if (aRequest.IsPostOperation())
		{
		_LOG(_L("CPreModifierPlugin::FsFileTempL, post intercept"));

		RFilePlugin fileplugin(aRequest);
		TInt err = fileplugin.AdoptFromClient();
		iLastError = err;
		iLineNumber = __LINE__;
		if(err!=KErrNone)
			User::Leave(err); //trapped in DoRequestL
		
		//write to the newly created temp file
		TBuf8<64> wbuffer;
		wbuffer.Copy(_L8("TestTestTest"));
		err = fileplugin.Write(0, wbuffer);
		_LOG2(_L("CPreModifierPlugin::FsFileTempL, RFilePlugin::Write to the newly created temp file returned %d"), err);
		iLastError = err;
		iLineNumber = __LINE__;
		if(err!=KErrNone)
			User::Leave(err); //trapped in DoRequestL

		TInt length = wbuffer.Length();
		HBufC8* tempBuf = HBufC8::NewMaxLC(length);
		TPtr8 tempBufPtr((TUint8 *)tempBuf->Des().Ptr(), length, length);
		err = fileplugin.Read(0, tempBufPtr);
		_LOG2(_L("CPreModifierPlugin::FsFileTempL, RFilePlugin::Read returned %d"), err);
		iLastError = err;
		iLineNumber = __LINE__;
		if(err!=KErrNone)
			User::Leave(err); //trapped in DoRequestL
		
		fileplugin.Close();

		//testing the correct thing has been written to the drive
		err = wbuffer.Compare(tempBufPtr);
		iLastError = err;
		iLineNumber = __LINE__;
		if(err!=KErrNone)
			User::Leave(err); //trapped in DoRequestL
			
		CleanupStack::PopAndDestroy();
		}
	else
		{
		User::Invariant();
		}
	}
static void dump_thread(log_t* log, pid_t tid, bool attached,
        bool* detach_failed, int* total_sleep_time_usec) {
    char path[PATH_MAX];
    char threadnamebuf[1024];
    char* threadname = NULL;
    FILE* fp;

    snprintf(path, sizeof(path), "/proc/%d/comm", tid);
    if ((fp = fopen(path, "r"))) {
        threadname = fgets(threadnamebuf, sizeof(threadnamebuf), fp);
        fclose(fp);
        if (threadname) {
            size_t len = strlen(threadname);
            if (len && threadname[len - 1] == '\n') {
                threadname[len - 1] = '\0';
            }
        }
    }

    _LOG(log, SCOPE_AT_FAULT, "\n\"%s\" sysTid=%d\n",
            threadname ? threadname : "<unknown>", tid);

    if (!attached && ptrace(PTRACE_ATTACH, tid, 0, 0) < 0) {
        _LOG(log, SCOPE_AT_FAULT, "Could not attach to thread: %s\n", strerror(errno));
        return;
    }

    wait_for_stop(tid, total_sleep_time_usec);

    backtrace_context_t context;
    if (!backtrace_create_context(&context, tid, -1, 0)) {
        _LOG(log, SCOPE_AT_FAULT, "Could not create backtrace context.\n");
    } else {
        dump_backtrace_to_log(&context, log, SCOPE_AT_FAULT, "  ");
        backtrace_destroy_context(&context);
    }

    if (!attached && ptrace(PTRACE_DETACH, tid, 0, 0) != 0) {
        LOG("ptrace detach from %d failed: %s\n", tid, strerror(errno));
        *detach_failed = true;
    }
}
static void dump_thread(
    log_t* log, pid_t tid, bool attached, bool* detach_failed, int* total_sleep_time_usec) {
  char path[PATH_MAX];
  char threadnamebuf[1024];
  char* threadname = NULL;
  FILE* fp;

  snprintf(path, sizeof(path), "/proc/%d/comm", tid);
  if ((fp = fopen(path, "r"))) {
    threadname = fgets(threadnamebuf, sizeof(threadnamebuf), fp);
    fclose(fp);
    if (threadname) {
      size_t len = strlen(threadname);
      if (len && threadname[len - 1] == '\n') {
          threadname[len - 1] = '\0';
      }
    }
  }

  _LOG(log, logtype::BACKTRACE, "\n\"%s\" sysTid=%d\n", threadname ? threadname : "<unknown>", tid);

  if (!attached && ptrace(PTRACE_ATTACH, tid, 0, 0) < 0) {
    _LOG(log, logtype::BACKTRACE, "Could not attach to thread: %s\n", strerror(errno));
    return;
  }

  if (!attached && wait_for_sigstop(tid, total_sleep_time_usec, detach_failed) == -1) {
    return;
  }

  std::unique_ptr<Backtrace> backtrace(Backtrace::Create(tid, BACKTRACE_CURRENT_THREAD));
  if (backtrace->Unwind(0)) {
    dump_backtrace_to_log(backtrace.get(), log, "  ");
  } else {
    ALOGE("Unwind failed: tid = %d", tid);
  }

  if (!attached && ptrace(PTRACE_DETACH, tid, 0, 0) != 0) {
    ALOGE("ptrace detach from %d failed: %s\n", tid, strerror(errno));
    *detach_failed = true;
  }
}
Example #5
0
// If configured to do so, dump memory around *all* registers
// for the crashing thread.
void dump_memory_and_code(log_t* log, pid_t tid, int scope_flags) {
  pt_regs_mips_t r;
  if (ptrace(PTRACE_GETREGS, tid, 0, &r)) {
    return;
  }

  if (IS_AT_FAULT(scope_flags) && DUMP_MEMORY_FOR_ALL_REGISTERS) {
    static const char REG_NAMES[] = "$0atv0v1a0a1a2a3t0t1t2t3t4t5t6t7s0s1s2s3s4s5s6s7t8t9k0k1gpsps8ra";

    for (int reg = 0; reg < 32; reg++) {
      // skip uninteresting registers
      if (reg == 0 // $0
          || reg == 26 // $k0
          || reg == 27 // $k1
          || reg == 31 // $ra (done below)
         )
        continue;

      uintptr_t addr = R(r.regs[reg]);

      // Don't bother if it looks like a small int or ~= null, or if
      // it's in the kernel area.
      if (addr < 4096 || addr >= 0x80000000) {
        continue;
      }

      _LOG(log, scope_flags | SCOPE_SENSITIVE, "\nmemory near %.2s:\n", &REG_NAMES[reg * 2]);
      dump_memory(log, tid, addr, scope_flags | SCOPE_SENSITIVE);
    }
  }

  unsigned int pc = R(r.cp0_epc);
  unsigned int ra = R(r.regs[31]);

  _LOG(log, scope_flags, "\ncode around pc:\n");
  dump_memory(log, tid, (uintptr_t)pc, scope_flags);

  if (pc != ra) {
    _LOG(log, scope_flags, "\ncode around ra:\n");
    dump_memory(log, tid, (uintptr_t)ra, scope_flags);
  }
}
/**
@internalComponent
*/
void CPreModifierPlugin::FsDirReadPackedL(TFsPluginRequest& aRequest)
	{
	if (aRequest.IsPostOperation())
		{
		_LOG(_L("CPreModifierPlugin::FsDirReadPackedL, post intercept"));
		}
	else
		{
		User::Invariant();
		}
	}
void log_params(const string& l_arg, AmSession* sess,
		DSMSession* sc_sess, map<string,string>* event_params) {
  unsigned int lvl;
  if (str2i(resolveVars(l_arg, sess, sc_sess, event_params), lvl)) {
    ERROR("unknown log level '%s'\n", l_arg.c_str());
    return;
  }

  if (NULL == event_params) {
    _LOG((int)lvl, "FSM: no event params ---\n");
    return;
  }

  _LOG((int)lvl, "FSM: params set ---\n");
  for (map<string, string>::iterator it = 
	 event_params->begin(); it != event_params->end(); it++) {
    _LOG((int)lvl, "FSM:  #%s='%s'\n", it->first.c_str(), it->second.c_str());
  }
  _LOG((int)lvl, "FSM: params end ---\n");
}
Example #8
0
/**
Enable the plugin's intercepts.
@internalComponent
*/
void CExclusiveAccessPlugin::EnableInterceptsL()
	{
	if (iInterceptsEnabled) return;
	
	User::LeaveIfError(RegisterIntercept(EFsFileRead,		EPrePostIntercept));
	User::LeaveIfError(RegisterIntercept(EFsFileWrite,		EPrePostIntercept));

	_LOG(_L("CExclusiveAccessPlugin : Enabled intercepts."));
    
	iInterceptsEnabled = ETrue;
	}
/**
@internalComponent
*/
void CPreModifierPlugin::FsFileSubCloseL(TFsPluginRequest& aRequest)
	{
	if (aRequest.IsPostOperation())
		{
		_LOG(_L("CPreModifierPlugin::FsFileSubCloseL, post intercept"));
		}
	else
		{
		User::Invariant();
		}
	}
Example #10
0
void dump_registers(int tfd, int pid, bool at_fault) 
{
    struct pt_regs r;
    bool only_in_tombstone = !at_fault;

    if(ptrace(PTRACE_GETREGS, pid, 0, &r)) {
        _LOG(tfd, only_in_tombstone, 
             "cannot get registers: %s\n", strerror(errno));
        return;
    }
    
    _LOG(tfd, only_in_tombstone, " r0 %08x  r1 %08x  r2 %08x  r3 %08x\n",
         r.ARM_r0, r.ARM_r1, r.ARM_r2, r.ARM_r3);
    _LOG(tfd, only_in_tombstone, " r4 %08x  r5 %08x  r6 %08x  r7 %08x\n",
         r.ARM_r4, r.ARM_r5, r.ARM_r6, r.ARM_r7);
    _LOG(tfd, only_in_tombstone, " r8 %08x  r9 %08x  10 %08x  fp %08x\n",
         r.ARM_r8, r.ARM_r9, r.ARM_r10, r.ARM_fp);
    _LOG(tfd, only_in_tombstone, 
         " ip %08x  sp %08x  lr %08x  pc %08x  cpsr %08x\n",
         r.ARM_ip, r.ARM_sp, r.ARM_lr, r.ARM_pc, r.ARM_cpsr);  
}
void dump_registers(log_t* log, pid_t tid) {
  pt_regs r;
  if (ptrace(PTRACE_GETREGS, tid, 0, &r)) {
    ALOGE("cannot get registers: %s\n", strerror(errno));
    return;
  }

  DUMP_GP_REGISTERS(log, r.ARM_);

  user_vfp vfp_regs;
  if (ptrace(PTRACE_GETVFPREGS, tid, 0, &vfp_regs)) {
    ALOGE("cannot get FP registers: %s\n", strerror(errno));
    return;
  }

  for (size_t i = 0; i < 32; i += 2) {
    _LOG(log, logtype::FP_REGISTERS, "    d%-2d %016llx  d%-2d %016llx\n",
         i, vfp_regs.fpregs[i], i+1, vfp_regs.fpregs[i+1]);
  }
  _LOG(log, logtype::FP_REGISTERS, "    scr %08lx\n", vfp_regs.fpscr);
}
Example #12
0
void dump_crash_banner(int tfd, unsigned pid, unsigned tid, int sig)
{
    char data[1024];
    char *x = 0;
    FILE *fp;
    
    sprintf(data, "/proc/%d/cmdline", pid);
    fp = fopen(data, "r");
    if(fp) {
        x = fgets(data, 1024, fp);
        fclose(fp);
    }
    
    _LOG(tfd, false,
         "*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n");
    dump_build_info(tfd);
    _LOG(tfd, false, "pid: %d, tid: %d  >>> %s <<<\n",
         pid, tid, x ? x : "UNKNOWN");
    
    if(sig) dump_fault_addr(tfd, tid, sig);
}
Example #13
0
void zrtp_log(int level, char *data, int len, int offset) {
  int sems_lvl = L_DBG;
  if (level==2)
    sems_lvl = L_WARN; // ??
  else if (level==1)
    sems_lvl = L_INFO; // ??
  
  if (sems_lvl==L_DBG && !AmConfig::enable_zrtp_debuglog)
    return;

  _LOG(sems_lvl, "%.*s", len, data);
}
Example #14
0
int logerr_check(){
    const unsigned count=TK_errorCount;
    TK_errorCount=0;

    if(TK_warnCount){
        _LOG(WARNCOLOR "Notice:" RESETCOLOR " There were %u warnings. Sumaries are shown below, check logs for full details.\n",TK_warnCount);
        for (unsigned i=0; i < TK_warnCount; ++i){
            _LOG(BOLDCOLOR "Warning #%u:" RESETCOLOR " %s\n",i+1,TK_warnlog[i]);
            if(i > TK_MAX_ERROR_LEN){
                _LOG(WARNCOLOR "   ... too many warnings\n" RESETCOLOR);
                break;
            }
        }
        TK_warnCount=0;
    }

    if(count){
        _LOG("\n\n" ERRORCOLOR "Notice:" RESETCOLOR " There were %u errors! Sumaries are shown below, check logs for full details.\n",count);
        for (unsigned i=0; i < count; ++i){
            _LOG(ERRORCOLOR "Error #%u" RESETCOLOR " = " BOLDCOLOR "%s" RESETCOLOR ENDL,i+1,TK_errorlog[i]);
            if(i > TK_MAX_ERROR_LEN){
                _LOG(ERRORCOLOR "  ... too many errors\n" RESETCOLOR);
                break;
            }

        }
    }
    return count;
}
Example #15
0
void dump_registers(log_t* log, pid_t tid) {
  pt_regs r;
  if (ptrace(PTRACE_GETREGS, tid, 0, &r)) {
    ALOGE("cannot get registers: %s\n", strerror(errno));
    return;
  }

  _LOG(log, logtype::REGISTERS, "    r0 %08x  r1 %08x  r2 %08x  r3 %08x\n",
       static_cast<uint32_t>(r.ARM_r0), static_cast<uint32_t>(r.ARM_r1),
       static_cast<uint32_t>(r.ARM_r2), static_cast<uint32_t>(r.ARM_r3));
  _LOG(log, logtype::REGISTERS, "    r4 %08x  r5 %08x  r6 %08x  r7 %08x\n",
       static_cast<uint32_t>(r.ARM_r4), static_cast<uint32_t>(r.ARM_r5),
       static_cast<uint32_t>(r.ARM_r6), static_cast<uint32_t>(r.ARM_r7));
  _LOG(log, logtype::REGISTERS, "    r8 %08x  r9 %08x  sl %08x  fp %08x\n",
       static_cast<uint32_t>(r.ARM_r8), static_cast<uint32_t>(r.ARM_r9),
       static_cast<uint32_t>(r.ARM_r10), static_cast<uint32_t>(r.ARM_fp));
  _LOG(log, logtype::REGISTERS, "    ip %08x  sp %08x  lr %08x  pc %08x  cpsr %08x\n",
       static_cast<uint32_t>(r.ARM_ip), static_cast<uint32_t>(r.ARM_sp),
       static_cast<uint32_t>(r.ARM_lr), static_cast<uint32_t>(r.ARM_pc),
       static_cast<uint32_t>(r.ARM_cpsr));

  user_vfp vfp_regs;
  if (ptrace(PTRACE_GETVFPREGS, tid, 0, &vfp_regs)) {
    ALOGE("cannot get FP registers: %s\n", strerror(errno));
    return;
  }

  for (size_t i = 0; i < 32; i += 2) {
    _LOG(log, logtype::FP_REGISTERS, "    d%-2d %016llx  d%-2d %016llx\n",
         i, vfp_regs.fpregs[i], i+1, vfp_regs.fpregs[i+1]);
  }
  _LOG(log, logtype::FP_REGISTERS, "    scr %08lx\n", vfp_regs.fpscr);
}
Example #16
0
 static PyObject* mod_py_log(PyObject*, PyObject* args)
 {
   int level;
   char *msg;
   
   if(!PyArg_ParseTuple(args,"is",&level,&msg))
     return NULL;
   
   _LOG(level, "%s", msg);
 
   Py_INCREF(Py_None);
   return Py_None;
 }
static void dump_process_header(log_t* log, pid_t pid) {
    char path[PATH_MAX];
    char procnamebuf[1024];
    char* procname = NULL;
    FILE* fp;

    snprintf(path, sizeof(path), "/proc/%d/cmdline", pid);
    if ((fp = fopen(path, "r"))) {
        procname = fgets(procnamebuf, sizeof(procnamebuf), fp);
        fclose(fp);
    }

    time_t t = time(NULL);
    struct tm tm;
    localtime_r(&t, &tm);
    char timestr[64];
    strftime(timestr, sizeof(timestr), "%F %T", &tm);
    _LOG(log, SCOPE_AT_FAULT, "\n\n----- pid %d at %s -----\n", pid, timestr);

    if (procname) {
        _LOG(log, SCOPE_AT_FAULT, "Cmd line: %s\n", procname);
    }
}
// ---------------------------------------------------------------------------
// CAknMemorySelectionModelMultiDrive::ReadResourcesL
// ---------------------------------------------------------------------------
//
void CAknMemorySelectionModelMultiDrive::ReadResourcesL()
    {
    HBufC* buffer;
    TInt resource;
    for( TInt locStrIndex( 0 ); locStrIndex < ETextCount; locStrIndex++ )
        {
        resource = 0;
        // Resource depends on the layout type (TListBoxLayout):
        switch( iLayout )
            {
            case ELayoutPopupMenu:
                {
                resource = ResourceIDForLayoutPopupMenuItem( locStrIndex );
                break;
                }
            case ELayoutSettingPage:
                {
                resource = ResourceIDForLayoutSettingPageItem( locStrIndex );
                break;
                }
            case ELayoutDoublePopup:
                {
                resource = ResourceIDForLayoutDoublePopupItem( locStrIndex );
                break;
                }
            default:
                {
                User::Panic( KCFDPanicText, ECFDPanicOutOfBounds );
                }
            }//iLayout

        if( resource )
            {
            buffer = NULL;
            buffer = iCoeEnv->AllocReadResourceLC( resource );
            User::LeaveIfError( iLocStringArray.Append( buffer ) );
            CleanupStack::Pop();
            }

        }//For loop

#ifdef _DEBUG
        _LOG( "[CAknMemorySelectionModelMultiDrive] iLocStringArray: " );
        for( TInt lsa = 0; lsa < iLocStringArray.Count(); lsa++ )
            {
            _LOG1( "%S",iLocStringArray[ lsa ] );
            }
#endif // _DEBUG
    }
/**
@internalComponent
*/
void CPreModifierPlugin::FsFileWriteL(TFsPluginRequest& aRequest)
	{
	TInt err = KErrNone;
	TInt length = 0;
	TInt64 pos = 0;
	TFileName filename;
	TParse parse;

	TBuf<256> testfilename1;
	TBuf<256> testfilename2;

	//setting up test files
	testfilename1.Append(iDriveToTest);
	testfilename1.Append(_L(":\\Data\\test.txt"));

	testfilename2.Append(iDriveToTest);
	testfilename2.Append(_L(":\\Data\\createcreate3.txt"));

	err = aRequest.FileName(filename);
	iLastError = err;
	iLineNumber = __LINE__;
	if(err!=KErrNone)
		User::Leave(err); //trapped in DoRequestL

	err = aRequest.Read(TFsPluginRequest::ELength, length);
	iLastError = err;
	iLineNumber = __LINE__;
	if(err!=KErrNone)
		User::Leave(err); //trapped in DoRequestL
	
	err = aRequest.Read(TFsPluginRequest::EPosition, pos);
	iLastError = err;
	iLineNumber = __LINE__;
	if(err!=KErrNone)
		User::Leave(err); //trapped in DoRequestL

    parse.Set(filename, NULL, NULL);

	_LOG4(_L("CPreModifierPlugin::FsFileWriteL, file: %S, pos: %d, length: %d"), &filename, pos, length);
	
	if (aRequest.IsPostOperation())
		{
		_LOG(_L("CPreModifierPlugin::FsFileWriteL, post intercept"));
		}
	else
		{
			User::Invariant();
		}
	}
static void dump_thread_info(log_t* log, pid_t pid, pid_t tid, bool at_fault) {
    char path[64];
    char threadnamebuf[1024];
    char* threadname = NULL;
    FILE *fp;

    snprintf(path, sizeof(path), "/proc/%d/comm", tid);
    if ((fp = fopen(path, "r"))) {
        threadname = fgets(threadnamebuf, sizeof(threadnamebuf), fp);
        fclose(fp);
        if (threadname) {
            size_t len = strlen(threadname);
            if (len && threadname[len - 1] == '\n') {
                threadname[len - 1] = '\0';
            }
        }
    }

    if (at_fault) {
        char procnamebuf[1024];
        char* procname = NULL;

        snprintf(path, sizeof(path), "/proc/%d/cmdline", pid);
        if ((fp = fopen(path, "r"))) {
            procname = fgets(procnamebuf, sizeof(procnamebuf), fp);
            fclose(fp);
        }

        _LOG(log, false, "pid: %d, tid: %d, name: %s  >>> %s <<<\n", pid, tid,
                threadname ? threadname : "UNKNOWN",
                procname ? procname : "UNKNOWN");
    } else {
        _LOG(log, true, "pid: %d, tid: %d, name: %s\n", pid, tid,
                threadname ? threadname : "UNKNOWN");
    }
}
void log_selects(const string& l_arg, AmSession* sess,
		 DSMSession* sc_sess, map<string,string>* event_params) {
  unsigned int lvl;
  if (str2i(resolveVars(l_arg, sess, sc_sess, event_params), lvl)) {
    ERROR("unknown log level '%s'\n", l_arg.c_str());
    return;
  }

  _LOG((int)lvl, "FSM: selects set ---\n");

#define SELECT_LOG(select_name)					\
  _LOG((int)lvl, "FSM:  @%s='%s'\n", select_name,			\
       resolveVars("@" select_name, sess, sc_sess, event_params).c_str());	

  SELECT_LOG("local_tag");
  SELECT_LOG("user");
  SELECT_LOG("domain");
  SELECT_LOG("remote_tag");
  SELECT_LOG("callid");
  SELECT_LOG("local_uri");
  SELECT_LOG("remote_uri");
#undef SELECT_LOG
  _LOG((int)lvl, "FSM: selects end ---\n");
}
bool SCLogAction::execute(AmSession* sess, 
			  DSMCondition::EventType event,
			  map<string,string>* event_params) {
  GET_SCSESSION();
  
  unsigned int lvl;
  if (str2i(resolveVars(par1, sess, sc_sess, event_params), lvl)) {
    ERROR("unknown log level '%s'\n", par1.c_str());
    return false;
  }
  string l_line = resolveVars(par2, sess, sc_sess, event_params).c_str();
  _LOG((int)lvl, "FSM: %s %s\n", (par2 != l_line)?par2.c_str():"",
       l_line.c_str());
  return false;
}
void CPokerCardList::printInfoToLog()
{
	CPokerCard* pPokderCardGet = NULL;
	std::list<CPokerCard*>::iterator  iterList;

	_LOG(SourceFLInfo, DebugDebug, "CPokerCardList [size=%d]", m_pPokerCardList->size());

	iterList = m_pPokerCardList->begin();
	while (iterList != m_pPokerCardList->end())
	{
		pPokderCardGet = *iterList;
		pPokderCardGet->printInfoToLog();
		iterList++;
	}//while
}
void dump_memory_and_code(log_t* log, Backtrace* backtrace) {
  struct user_regs_struct r;
  if (ptrace(PTRACE_GETREGS, backtrace->Tid(), 0, &r) == -1) {
    _LOG(log, logtype::ERROR, "cannot get registers: %s\n", strerror(errno));
    return;
  }

  dump_memory(log, backtrace, static_cast<uintptr_t>(r.rax), "memory near rax:");
  dump_memory(log, backtrace, static_cast<uintptr_t>(r.rbx), "memory near rbx:");
  dump_memory(log, backtrace, static_cast<uintptr_t>(r.rcx), "memory near rcx:");
  dump_memory(log, backtrace, static_cast<uintptr_t>(r.rdx), "memory near rdx:");
  dump_memory(log, backtrace, static_cast<uintptr_t>(r.rsi), "memory near rsi:");
  dump_memory(log, backtrace, static_cast<uintptr_t>(r.rdi), "memory near rdi:");

  dump_memory(log, backtrace, static_cast<uintptr_t>(r.rip), "code around rip:");
}
Example #25
0
// ---------------------------------------------------------------------------
// CAiPlayerPluginEngine::~CAiPlayerPluginEngine
// ---------------------------------------------------------------------------
//
CAiPlayerPluginEngine::~CAiPlayerPluginEngine()
    {
    //MPX_DEBUG1("CAiPlayerPluginEngine::~CAiPlayerPluginEngine");
	_LOG(_L("~CAiPlayerPluginEngine"));
    if ( iPlaybackUtility )
        {
    	//iPlaybackUtility->CancelRequest();
    	//iPlaybackUtility->ClearSubscriptionsL();
    	//iPlaybackUtility->RemoveObserverL(*this);
    	//iPlaybackUtility->Close();
        //iPlaybackUtility=NULL;
        }
    if (iMedia){delete iMedia;}
    if (iTitle){delete iTitle;}
    if (iArtist){delete iArtist;}
    if (iUri){delete iUri;} 
    }
Example #26
0
void AmSipDispatcher::handleSipMsg(const string& dialog_id, AmSipReply &reply)
{
  const string& id = dialog_id.empty() ? reply.from_tag : dialog_id;
  AmSipReplyEvent* ev = new AmSipReplyEvent(reply);

  if(!AmEventDispatcher::instance()->post(id,ev)){
    if ((reply.code >= 100) && (reply.code < 300)) {
      if (AmConfig::UnhandledReplyLoglevel >= 0) {
	_LOG(AmConfig::UnhandledReplyLoglevel,
	     "unhandled SIP reply: %s\n", reply.print().c_str());
      }
    } else {
      WARN("unhandled SIP reply: %s\n", reply.print().c_str());
    }
    delete ev;
  }
}
void CPreModifierPlugin::FsDirReadOneL(TFsPluginRequest& aRequest)
	{

	TFileName name;
	TInt err = aRequest.FileName(name);
	iLastError = err;
	iLineNumber = __LINE__;
	if(err!=KErrNone)
		User::Leave(err); //trapped in DoRequestL
	
	if (aRequest.IsPostOperation())
		{
		_LOG(_L("CPreModifierPlugin::FsDirReadOneL, post intercept"));
		}
	else
		{
		User::Invariant();
		}
	}
Example #28
0
void zrtp_print_log(log_level_t level, const char* format, ...)
{
	char buffer[BUFFER_LOG_SIZE];
    va_list arg;

    va_start(arg, format);
    vsnprintf(buffer, BUFFER_LOG_SIZE, format, arg);
    va_end( arg );
    int sems_lvl = L_ERR;
    switch(level) {
    case ZRTP_LOG_DEBUG:   sems_lvl = L_DBG; break;
    case ZRTP_LOG_INFO:    sems_lvl = L_INFO; break;
    case ZRTP_LOG_WARNING: sems_lvl = L_WARN; break;
    case ZRTP_LOG_ERROR:   sems_lvl = L_ERR; break;
    case ZRTP_LOG_FATAL:   sems_lvl = L_ERR; break;
    case ZRTP_LOG_ALL:   sems_lvl = L_ERR; break;
    }
    _LOG(sems_lvl, "*** %s", buffer);
}
void CPreModifierPlugin::FsRenameL(TFsPluginRequest& aRequest)
	{
	TInt err = KErrNone;
	TFileName oldfilename;
	TFileName newfilename;

	oldfilename = aRequest.Src().FullName();
	newfilename = aRequest.Dest().FullName();

	TBuf<256> testfilename1;

	//setting up test files
	testfilename1.Append(iDriveToTest);
	testfilename1.Append(_L(":\\Data\\test.txt"));

	if (aRequest.IsPostOperation())
		{
		_LOG(_L("CPreModifierPlugin::FsRenameL, post intercept"));
		RFilePlugin fileplugin2(aRequest);
		//open a second file
		err = fileplugin2.Open(testfilename1, EFileWrite);
		_LOG3(_L("CPreModifierPlugin::FsRenameL, RFilePlugin::Open for %S returned %d"), &testfilename1, err);
		iLastError = err;
		iLineNumber = __LINE__;
		if(err!=KErrNone)
			User::Leave(err); //trapped in DoRequestL
								
		TInt64 size=0;
		err = fileplugin2.Size(size);
		iLastError = err;
		iLineNumber = __LINE__;
		if(err!=KErrNone)
			User::Leave(err); //trapped in DoRequestL		

		//close the second file
		fileplugin2.Close();
		_LOG2(_L("CPreModifierPlugin::FsRenameL, RFilePlugin::Close to the second file returned %d"), err);
		}
	else
		{
		User::Invariant();
		}
	}
Example #30
0
void dump_registers(int tfd, int pid, bool at_fault)
{
    struct pt_regs r;
    bool only_in_tombstone = !at_fault;

    if(ptrace(PTRACE_GETREGS, pid, 0, &r)) {
        _LOG(tfd, only_in_tombstone,
             "cannot get registers: %s\n", strerror(errno));
        return;
    }

    _LOG(tfd, only_in_tombstone, " r0 %08x  r1 %08x  r2 %08x  r3 %08x\n",
         r.ARM_r0, r.ARM_r1, r.ARM_r2, r.ARM_r3);
    _LOG(tfd, only_in_tombstone, " r4 %08x  r5 %08x  r6 %08x  r7 %08x\n",
         r.ARM_r4, r.ARM_r5, r.ARM_r6, r.ARM_r7);
    _LOG(tfd, only_in_tombstone, " r8 %08x  r9 %08x  10 %08x  fp %08x\n",
         r.ARM_r8, r.ARM_r9, r.ARM_r10, r.ARM_fp);
    _LOG(tfd, only_in_tombstone,
         " ip %08x  sp %08x  lr %08x  pc %08x  cpsr %08x\n",
         r.ARM_ip, r.ARM_sp, r.ARM_lr, r.ARM_pc, r.ARM_cpsr);

#ifdef WITH_VFP
    struct user_vfp vfp_regs;
    int i;

    if(ptrace(PTRACE_GETVFPREGS, pid, 0, &vfp_regs)) {
        _LOG(tfd, only_in_tombstone,
             "cannot get registers: %s\n", strerror(errno));
        return;
    }

    for (i = 0; i < NUM_VFP_REGS; i += 2) {
        _LOG(tfd, only_in_tombstone,
             " d%-2d %016llx  d%-2d %016llx\n",
              i, vfp_regs.fpregs[i], i+1, vfp_regs.fpregs[i+1]);
    }
    _LOG(tfd, only_in_tombstone, " scr %08lx\n\n", vfp_regs.fpscr);
#endif
}