想象这个假的程序:
void foo ( void )
{
// anything
}
int main ()
{
foo ();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
当使用Visual Studio在调试模式下编译时,编译器会构建某种"函数映射",或者调用它.
因此,当您在调试器中跟踪foo(),或者只是尝试通过&foo检索函数的偏移量时,您会发现自己处于jmp的"列表"中,当您再次关注它们时会引导您进入实际函数身体.
我的问题是:是否有可能为单个选择函数禁用它,以便&foo将地址返回给函数体,而不是jmp.当然没有禁用调试模式.
如果没有,哪个标志启用/禁用整个程序?
提前致谢 !
编辑用户SigTerm:

我使用boost :: interprocess :: managed_(windows_)shared_memory :: construct来构造一个包含自己类的进程间向量,它有一个类型为std :: string的成员变量和另一个类型为std :: vector的成员变量,所以:
class myclass
{
public:
myclass()
{
}
std::string _mystring;
std::vector < int > _myintvector;
};
template < class _type >
struct typedefs
{
typedef boost::interprocess::managed_windows_shared_memory _memory;
typedef _memory::segment_manager _manager;
typedef boost::interprocess::allocator < _type, _manager > _allocator;
typedef boost::interprocess::vector < _type, _allocator > _vector;
};
typedef typedefs < myclass > tdmyclass;
int main ()
{
using namespace boost::interprocess;
managed_windows_shared_memory mem ( open_or_create, "mysharedmemory", 65536 );
tdmyclass::_vector * vec = mem.construct …Run Code Online (Sandbox Code Playgroud) 问题就在标题里。我在谷歌上找不到任何东西,所以我希望这里有人可以向我解释一下。
我使用的是 debian 6.0.5,在 /etc/passwd 文件中分配给执行用户的 shell 是 /bin/bash
因此,只需编写cd ~作品即可将我带到用户主目录。
test -d "~/some_dir"在 if 语句中返回 false ( some_dir exsits )
编辑:抱歉,我应该更清楚为什么我要写/bin/bash cd ~而不是cd ~:我正在编写一个 bash 脚本#!/bin/bash,上面提到的 if 语句最终出现在 false 子句中。