免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: linliedn
打印 上一主题 下一主题

弱问一个关于GDB的问题 [复制链接]

论坛徽章:
0
11 [报告]
发表于 2008-07-04 21:44 |只看该作者
这个要实现一个还真牛X了,拜一拜LZ这个神人。我这两年和debug无缘了。

论坛徽章:
0
12 [报告]
发表于 2008-07-07 19:50 |只看该作者
你的进程总是只能占一个核。把几个进程分配给几个核,形成并行,是操作系统和多核CPU的事。你的调试器没法介入之中。

论坛徽章:
0
13 [报告]
发表于 2008-07-19 08:40 |只看该作者

Towards multiprocess GDB

Stan Shebs       
CodeSourcery has a project to add "multiprocess" capability to GDB, and with ...
       
4:40 (3小时前)
Stan Shebs正在载入...       
4:40 (3小时前)
Stan Shebs
发送至 gdb
       
显示详细信息 4:40 (3小时前)
       
       
回复
       
       
CodeSourcery has a project to add "multiprocess" capability to GDB,
and with this message I'd like to kick off some discussion of what
that means and how to make it happen.

To put it simply, the goal of the project is to make this command work
in some useful way:

gdb prog1 prog2 pid2 prog3 prog4

As the command suggests, we're talking about multiple programs or
executables being controlled by a single GDB, in contrast to a single
program with multiple processes or forks, a la Michael's machinery for
Linux forks. So although we often use the term "multiprocess", it's
perhaps more precise to call it "multiprogram" or "multiexec" GDB.

The first thing is to figure out is how this should all work for the GDB
user. The command above seems like a pretty obvious extension;
programmers debugging client/server pairs have long wanted to be able
to do just that, and we've always had to tell them they have to start
up two GDBs and juggle. Since both core files and process ids are
distinguishable from executable names, we can allow intermixing of all
these on the command line, so that multiple core file and pid
arguments apply to the preceding executables.

Once the debugger is started, but before any of the programs have run,
it seems obvious to have a notion of "current program", so that commands
like "list main" and "break main" will work as usual. The user should
have a way to list the programs ("info programs") and a way to set the
current one. It might also make sense to have a menu option a la C++,
so that "list client_only_fn" works irrespective of the current program,
while "list main" might ask the user which main() is wanted. Another
possibility is to introduce a "program apply <names>|all <cmd>" on the
analogy of the existing thread apply command.

Notice that we don't really want to use the term "process" for any of
this so far, because nothing is running yet and there are no
processes/inferiors; this part is all about the symbol side.

Commands like "file" should get an alternate form or behavior that
adds rather than replaces. Conversely, the user will also want a way
to take programs out of the debugging session. This is not quite the
same as detaching, because the user may want, say, the server to
continue doing its serving thing, but also to have the list etc
commands only work on the client code, no longer be ambiguous.

When it's time to run, the user will want the ability to run anywhere
from one to all of the programs, each with its own argument list. It
should be possible to do this with a single command, so that the user
isn't scrambling to put in all the run commands quickly enough.

Once programs are running, execution control should work in a fashion
generally analogous to what we have for threads now. When something is
stopped, it needs to report program, process, and thread; step and
continue will need a way to specify the program or process being
stepped or continued. User-friendliness suggests that program name
should be accepted as a synonym for process id if there is only one
process for the executable.

Data display will need to have some way to identify the process from
which the data is being taken. It may be useful to have a "process
apply" for print commands, so that the output includes the value of
the expression in each process, especially useful for values that are
expected to be the same in each.

Implementationwise, we will need to replace the single exec target
with a list of execs, and modify symbol machinery to support a
many-many relationship between programs and symbol tables. Although
my inclination is to create a new symbol table for each process'
image of each shared library, that may be excessively expensive.

In addition to thoughts on desired user interface, I would welcome
suggestions on how to add this feature incrementally; the abovementioned
bits are a lot to add all at once!

Stan

论坛徽章:
0
14 [报告]
发表于 2008-07-19 12:18 |只看该作者
原帖由 cjaizss 于 2008-7-4 21:37 发表
SMP我就不说了,我说说非对称式的.
两个CPU硬核,两个不同的地址空间,接的是不同的RAM.
这个你很容易理解.
两个CPU硬核,相同的地址空间,接的是相同的RAM.
那么它们只是可以在访问相同的存储,然后其实还是各干 ...

版主对NUMA的理解是错误的。
NUMA也只有一个统一的物理地址空间

论坛徽章:
0
15 [报告]
发表于 2008-07-19 12:29 |只看该作者
此外我想不出多核的调试和单核的有什么不同

论坛徽章:
3
2015年迎新春徽章
日期:2015-03-04 09:56:11数据库技术版块每日发帖之星
日期:2016-08-03 06:20:00数据库技术版块每日发帖之星
日期:2016-08-04 06:20:00
16 [报告]
发表于 2008-07-19 13:06 |只看该作者
原帖由 zx_wing 于 2008-7-19 12:18 发表

版主对NUMA的理解是错误的。
NUMA也只有一个统一的物理地址空间

我在这里描述是有错误,有误导,我指的并非SMP/AMP,而是多处理器的嵌入式系统设计

论坛徽章:
0
17 [报告]
发表于 2008-07-19 13:14 |只看该作者
原帖由 cjaizss 于 2008-7-19 13:06 发表

我在这里描述是有错误,有误导,我指的并非SMP/AMP,而是多处理器的嵌入式系统设计

哦,那就不懂了。
我以为你说的是另一样东西
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP