一、break到不同类的同名函数

方法: 在函数前面加类名以及作用域运算符
eg : break A::func //break 到类A的func函数

程序如下:

//gdb_test.cpp

#include<iostream>

class A {
public:
void func() {
std::cout << "A::func() is called" << std::endl;
}
}; class B {
public:
void func() {
std::cout << "B::func() is called" << std::endl;
}
}; int main(int argc,char *argv[])
{
A a;
B b;
a.func();
b.func();
return 0;
}

调试过程如下:

[kiosk@localhost mess]$ gdb gdb_test
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-94.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/kiosk/practice/mess/gdb_test...done.
(gdb) b A::func //备注:break 到 A::func()位置处
Breakpoint 1 at 0x4008fa: file gdb_test.cpp, line 13.
(gdb) b B::func //备注:break 到 B::func()位置处
Breakpoint 2 at 0x400924: file gdb_test.cpp, line 20.
(gdb)

最新文章

  1. sass的四种css编译风格
  2. [原创]自定义控件之AndroidSegmentControlView,仿IOS平台UISegmentControlView,继承自View
  3. LINQ to Entities 查询语法
  4. 2014年互联网IT待遇【转载】
  5. MyBatis学习总结1
  6. 安装Visual Studio 2010之后怎样安装MSDN Library
  7. VIM下Express jade空格问题:expected &quot;indent&quot;, but got &quot;newline&quot;
  8. Libgdx Box2D现实------这缓释微丸(一个:项目介绍)
  9. 从头开始学JavaScript (八)——变量
  10. java应用测试报告生成(一): sonarqube配合Jenkins生成测试报告及覆盖率
  11. 使用Eclipse远程调试
  12. DBUtils温习2
  13. #15 time&amp;datetime&amp;calendar模块
  14. [dpdk] dpdk编译成动态库使用 -- PCI port自动发现与pmd动态加载
  15. 玩转X-CTR100 l STM32F4 l AT24C02 EEPROM存储
  16. Android 之 沉浸式状态栏及顶部状态栏背景色设置
  17. Gitlab-通过API管理项目
  18. C#学习笔记-原型模式
  19. Git添加本地项目出现fatal: unable to get credential storage lock: File exists
  20. winform 查看远程服务器上的文件

热门文章

  1. Linux系列(2) - 命令提示符
  2. Java面向对象系列(14)- 接口的定义与实现
  3. [转载]SELinux 环境下网络服务设置,配置 Apache 、Samba、NFS
  4. k8s负载资源StatefulSet工作解析
  5. python接口自动化--json解析神器jsonpath
  6. mybatis多种查询方法
  7. spring boot处理跨域请求代码
  8. 使用Golang搭建gRPC服务提供给.NetCore客户端调用
  9. NOIP 模拟五 考试总结
  10. Java(42)JDK新特性之接口组成