在GDB shell中,我可以从这样的地址获取符号名称:
(gdb) info symbol 0x405ece
top::test_thread() in section .text of test_procs
如何使用Python GDB API(https://sourceware.org/gdb/onlinedocs/gdb/Python-API.html)执行相同的操作?它有可能吗?
答案 0 :(得分:1)
这样的事情应该有效(未经测试):
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddDbContext<MyDbContext>(options =>
options.UseInMemoryDatabase()
);
...
}
public void Configure(
IApplicationBuilder app,
IHostingEnvironment env,
MyDbContext myDbContext)
{
myDbContext.Categories.Add(new Category {Id = 1, Name = "Category 1" });
myDbContext.SaveChanges();
app.UseMvc();
}