小编Hen*_*tle的帖子

如何在SIGSEGV上使用_Unwind_Backtrace获取fullstacktrace

我通过代码处理SIGSEGV:

int C()
{
  int *i = NULL;
  *i = 10; // Crash there
}

int B()
{
  return C();
}

int A()
{
   return B();
}

int main(void)
{
  struct sigaction handler;
  memset(&handler,0,sizeof(handler));
  handler.sa_sigaction = handler_func;
  handler.sa_flags = SA_SIGINFO;
  sigaction(SIGSEGV,&handler,NULL);
  return(C());
}
Run Code Online (Sandbox Code Playgroud)

处理程序代码在哪里:

static int handler_func(int signal, siginfo_t info, void* rserved)
{
  const void* stack[MAX_DEPTH];
  StackCrowlState state;
  state.addr = stack;
  state.count = MAX_DEPTH;

  _Unwind_Reason_Code code = _Unwind_Backtrace(trace_func,&state);
  printf("Stack trace count: %d, code: %d\n",MAX_DEPTH - state.count, code);

  kill(getpid(),SIGKILL);
}

static …
Run Code Online (Sandbox Code Playgroud)

c gcc signals stack-trace stack-unwinding

13
推荐指数
3
解决办法
9244
查看次数

帐户未显示在HTC设备上的联系人应用设置中

我根据SDK中的示例编写了自己的SyncAdapter.它应该从外部源添加联系人,它在设备模拟器中工作得很好.但是当我在HTC Desire上运行它后,我无法在Contacts-> Display选项中看到我的帐户

此外,我在Desire上尝试了谷歌的例子,也无法在这个列表中看到它们.有谁知道任何解决方案?

android contacts htc-android

7
推荐指数
1
解决办法
1920
查看次数

如何在Internet Explorer中使用全高度表创建全高度单元格

我有下一个HTML代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <style type="text/css">
    html {height:100%;}body {height:100%;margin:0;}
    h1 {form-size:20px;margin:0;padding:20px;}
  </style>
</head>
<body>
  <table style="width:100%;height:100%">
   <tr>
     <td>
       <div style="background-color:#f00;">
         <h1>This text should make height of this cell</h1>
       </div>
     </td>
   </tr>
   <tr style="height:100%;" id="row">
     <td style="background-color:#c0c;">
       <div style="height:100%;width:100%;background-color:#00f;color:#fff;">
         This cell should take all unused space of table
       </div>
     </td>
   </tr>
   <tr>
     <td>
       <div style="background-color:#0f0;">
        <h1>This text should make height of<br> this cell</h1>
       </div>
     </td>
   </tr>
  </table>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

它在所有浏览器中都很完美 - 除了IE,其中中间单元格中的蓝色div仅占用文本空间.可能有人知道如何将它拉伸到桌子内的整个自由空间?

更新:我知道页面布局中的表格不好.如果你能告诉我div格式的例子,它有顶部和底部块,可变高度和中间部分,使用浏览器窗口的所有可用空间,我将使用它.我保证=)

html css internet-explorer

2
推荐指数
1
解决办法
7089
查看次数