NetBeans调试不进入断点 5C

RedHat Enterprise Linux 6, C++ NetBeans下写的程序,主要是在main线程中创建了2个子线程,其中一个用libpcap来抓包并把包存到一个队列里,另一个线程是不断从队列里取包,利用pcap_dump方法存到.pcap文件里。现在程序遇到了几个问题:

发现在Linux C++程序一直运行一段时间,在数据量大时总是很容易出现terminate called after throwing an instance of std bad_alloc what():std::bad_alloc的错误,请问这是因为指针new和delete的时候没用好导致的吗,但好像也有人说频繁new和delete也会出现这种问题。
楼主C++不是很好,现在工作中总要用C++,而且同事也没有对Linux C++很熟悉的,所以还请懂的大神指点一二,多谢了。

Csdn user default icon
Netbeans 8.0.2调试器断点不起作用

<div class="post-text" itemprop="text"> <p>I just installed Netbeans for PHP (version 8.0.2). XDebug seemed to come with this installation. I'm trying to get the breakpoints and stepping through the code to work on my local machine, which is running WAMP, to work.</p> <p>I've never used debugging for PHP; only with Excel VBA, so I'm familiar with how breakpoints and stepping through code works. It seems that this feature comes with Netbeans/XDebug.</p> <p>But when I click on the debug button on the top middle of the screen, a bunch of buttons pop up. A good portion of them are greyed out and I am not able to use them. Specifically, the continue, step over, step into, step out, and run to cursor. The stop button is there, but works fine. When I click on debug, a new browser window opens and my code displays in the browser. It seems to ignore the breakpoint that I have placed in my code, though.</p> <p>I have breakpoints in my code, just to see how it all works in a PHP IDE, but I can't seem to get the breakpoints to work. My code is really nothing fancy; all I have is what is below:</p> <pre><code>&lt;?php echo "Hello world!&lt;br /&gt;"; echo "Google Chromium."; </code></pre> <p>I have a breakpoint on line 2 where it says "Hello world!" (I clicked on the left side of the code and a red box displayed next to the line of code).</p> <p>I am not really sure where to start with fixing this. XDebug shows up in my <code>phpinfo()</code> as version 2.2.5. I've seen some questions address changing some of the parameters in php.ini, but each seems very specific to the person who posts problem. I've checked the port to make sure it's 9000, I've also placed/changed the following code in my php.ini file:</p> <pre><code>[xdebug] xdebug.remote_enable = on xdebug.profiler_enable = on xdebug.profiler_enable_trigger = off xdebug.profiler_output_name = cachegrind.out.%t.%p xdebug.profiler_output_dir = "c:/wamp/tmp" xdebug.show_local_vars=0 xdebug.remote_handler=dbgp xdebug.remote_host=localhost xdebug.remote_port=9000 </code></pre> <p>How do I get breakpoints to work and stepping through code to work with Netbeans and XDebug?</p> </div>


<div class="post-text" itemprop="text"> <p>I have problem with xdebug because don't stop in some breakpoints. </p> <p>My project have MVC architecture and all worked fine with debugging while I created subcontrollers, because in subcontrollers breakpoints not working. If I put <code>xdebug_break()</code> in subcontroller then it works. </p> <p>I checked xdebug_remote.log</p> <p>This breakpoint not working</p> <pre><code>&lt;- breakpoint_set -i 1309 -t line -s enabled -f file:///var/www/my_project/app/controllers/settings/LanguageController.php -n 18 -&gt; &lt;response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="" command="breakpoint_set" transaction_id="1309" state="enabled" id="59770002"&gt;&lt;/response&gt; </code></pre> <p>This breakpoint working</p> <pre><code>&lt;- breakpoint_set -i 1310 -t line -s enabled -f file:///var/www/my_project/app/controllers/IndexController.php -n 15 -&gt; &lt;response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="" command="breakpoint_set" transaction_id="1310" state="enabled" id="59770003"&gt;&lt;/response&gt; </code></pre> <p>It's possible, that namespace is guilty? One difference between controller and subcontroller is namespace. In controller is it not defined, but in subcontroller is defined.</p> </div>


<div class="post-text" itemprop="text"> <p>Right i'm pulling my hair out on this one. </p> <p>I'm using Netbeans, EasyPHP, and Installed xdebug using by copy/pasting my phpinfo() results into the xdebug wizard which then tells you which .dll file you need to download.</p> <p>Well i've followed all the instructions, my phpinfo() now says xdebug is installed, I've added the appropiate lines in my php.ini file. However, my breakpoints in Netbeans do not work! I know that xdebug is installed because if I manually add <code>xdebug_break()</code> to my code then they act as a breakpoint.</p> <p>How can I get netbeans and breakpoints to work without manually using the xdebug php function everytime ?!</p> <p>PS. I know this question has been asked a million times but I've followed the other solutions and none have fixed my problem!</p> <p>I'm using XP if that shines any light on the matter?</p> </div>


![图片说明]( 单步调试到最后一行后,调试按钮都变成灰色了,如果还想返回到第一行重新调试,请问如何操作? 我现在的方法是按“Finish”按钮,然后再按“Debug File”, 感觉麻烦。


<div class="post-text" itemprop="text"> <p>The menu option is disabled for me. I can test ok and I can debug ok, just not both together. Is it possible, or is the menu option disabled because it isn't implemented for PHP.</p> <p>I'm hoping I don't need to go through the "Create Test files" procedure to enable it as I create the test files myself, rather than letting netbeans do it.</p> </div>


<div class="post-text" itemprop="text"> <p>I use Netbeans and debug code with xdebug for debugging php files that are remote from server. And I config to upload to the server when I save a file in Netbeans.</p> <p>I work in a team. I download some code that needs to be modified or added. So in Netbeans (in my computer) there are some old files that aren't updated from the server which is caused by people on the team who modified or added files in server.</p> <p>Example: Server has files <code>index.php</code> , <code>foo.php</code> , <code>bar.php</code> and my Netbeans has files <code>index.php</code> , <code>foo.php</code> , <code>bar.php</code> too, but <code>bar.php</code> in the server is updated by people on the team. But <code>bar.php</code> in my Netbeans is old file that isn't updated. So <code>bar.php</code> file in server is the newest <code>bar.php</code> in my Netbeans</p> <p>And code in <code>foo.php</code> calls function from <code>bar.php</code></p> <p><strong>Question</strong> If I am debugging in <code>foo.php</code> file. </p> <p>1) Netbean will upload <code>foo.php</code> file to server or not.</p> <p>2) Netbean will upload all files (in Netbeans) to server or not.</p> <p>3) If Answer 1) and 2) is not. In process debugging. Netbean will compile <code>bar.php</code> file from server or Netbeans </p> </div>


<div class="post-text" itemprop="text"> <p>Running PHP debug session in Netbeans always opens as a new tab in browser (I use Chrome and Firefox).</p> <p>How to force browser (or Netbeans) to run the session in the same browser tab, so I do not have n open tabs with the same url for debug?</p> </div>


<div class="post-text" itemprop="text"> <p>When I click the debug button, I get a browser open up pointing to the following url:</p> <pre><code>http://localhost/www/somepage.php?XDEBUG_SESSION_START=netbeans-xdebug </code></pre> <p>For some reason it keeps inserting the <code>www</code> into the url</p> <p>If I manually remove the <code>www</code> from the browser address bar, the debugging continues as it should.</p> <p>Anyone know how to get it to stop adding that <code>www</code> to the url?</p> </div>


<br /><img src="/upload/attachment/62094/93a9a44f-419c-3d13-9ff4-d83422297a72.gif" /> <br />如上图,调试的时候一直中断在88行,而我没有设置断点。 <br /> <br />有谁知道原因的?<img src="/images/smiles/icon_sad.gif" />


<div class="post-text" itemprop="text"> <p>I am trying to get a hang of netbeans (PHP) with xdebug.</p> <p>I have found out the way to do a debug is usually set the URL in netbeans, e.g.</p> <pre><code>http://localhost/muster/index.php?module=Wind&amp;Action=Test </code></pre> <p>then hit the debug button, but what do I do to debug a POST request? e.g.</p> <p>there is a javascript function in a .js file which calls a php file with POST, it is like this:</p> <pre><code> new Ajax.Request( 'index.php', { queue: {position: 'end', scope: 'command'}, method: 'post', postBody: "module=Wine&amp;action=WineAjax&amp;return_id="+id, onComplete: function(response) { .... </code></pre> <p>How do I set the URL to start the debugging?</p> <p>Many thanks for any input!</p> </div>

是否可以使用Netbeans 7.0和XDebug调试控制器代码

<div class="post-text" itemprop="text"> <p>Using any MVC Framework in PHP (say Zend Framework or CodeIgniter), is it possible to debug Controller Code meaningfully like I can debug a plain PHP script with Netbeans and XDebug. </p> <p>I means whenever I start debugging it start to Step Over the Code in index.php File. Is it possible to Step-Over code during Debugging inside Controller File and simulataneously observe XDEBUG rendered Output on the Web Browser.</p> <p>Because , being able to Step-Over only index.php is meaningless at all.</p> </div>

使用netbeans调试cakephp - 没有变量

<div class="post-text" itemprop="text"> <p>I set up cakephp debugging with netbeans and xdebug following these instructions <a href="" rel="nofollow"></a> . I got it working, but I cannot see any variables when I get to the breakpoints</p> </div>


require './Smarty/libs/Smarty.class.php'; $smarty = new Smarty(); $smarty->template_dir="./templates"; $smarty->compile_dir="./compile"; 在netbeans中调试php程序,调试运行到new Smarty();时,netbeans弹出套接字异常错误。 非调试运行时,程序运行正常。

Netbeans 8.2 php调试器停止标记当前行

<div class="post-text" itemprop="text"> <p>I've been using netbeans 8.2 for several self-contained Drupal sites. For no apparent reason the debugger stops informing the IDE's editor pane of the current line and does not open the current file. I can tell that the debugger is working because I can follow the execution through the Call Stack pane, which correctly shows the current file and line. I have been able to reproduce the same problem with local and remote projects. The xdebug log on the web server is also updated.</p> <p>I've been able to reproduce the problem with the nightly build of netbeans (netbeans-trunk-nightly-201804200002-php-windows-x64).</p> <p>The problem first manifested itself yesterday in the middle of the day. After rebooting the machine this morning it worked OK, but after about a half hour it reappeared. A new reboot did not help.</p> <p>I'd appreciate any suggestions at this point as to how to further investigate or actually solve this.</p> </div>

用netbeans调试cakephp - 没有变量[重复]

<div class="post-text" itemprop="text"> <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="">debugging cakephp with netbeans - no variables</a> </p> </blockquote> <p>i set up cakephp debugging with netbeans and xdebug following these instructions <a href="" rel="nofollow noreferrer"></a> , i got it working, but i cannot see any variables when i get to the breakpoints</p> </div>

NetBeans + XDebug断点无法正常工作

<div class="post-text" itemprop="text"> <p>I know there are countless of questions regarding this subject, however no matter what I've tried I've had no luck whatsoever. The problem I'm encountering is regarding breakpoints when using NetBeans and XDebug (on Windows 8.1 if that affects anything).</p> <p>The issue is that no breakpoints are working. By default when debugging with NetBeans, it stops on the first line and this does successfully happen. Therefore NetBeans is somehow connecting to XDebug. However, any other breakpoints in any other files are not working.</p> <p>I've tried various different settings in the php.ini file but no luck so far. I've also tried switching on the XDebug log file so that maybe I can analyse what's going on, but this also didn't work. Finally I've tried setting breakpoints using <code>xdebug_break()</code> which also didn't work.</p> <p><strong>XDebug settings in php.ini</strong></p> <pre><code>;[XDebug] ; Only Zend OR (!) XDebug zend_extension="C:\xampp\php\ext\php_xdebug.dll" xdebug.remote_enable=true xdebug.remote_host= xdebug.remote_port=9000 xdebug.remote_handler=dbgp xdebug.profiler_enable=1 xdebug.profiler_output_dir="C:\xampp\tmp" </code></pre> <p><strong>Project Run Configuration on NetBeans</strong></p> <p><img src="" alt="Project Run Configuration"></p> <p><img src="" alt="Advanced Configuration"></p> <p><em>I've already looked at the following:</em></p> <ul> <li><a href="" rel="nofollow noreferrer"></a></li> <li><a href="">Xdebug ignores breakpoints</a></li> <li><a href="" rel="nofollow noreferrer"></a></li> </ul> <p>Also note that this was working 3 days ago, however today no breakpoints are working.</p> <p><strong>Additional Info</strong></p> <p>I've run the following command in cmd <code>php -v</code> and the following warning was shown:</p> <p><code>Warning: Module 'xdebug' already loaded in Unknown on line 0</code></p> <p>Does this mean that xdebug is trying to be loaded twice? If so I'm not sure how this can be solved</p> </div>


java IDE NetBeans创建不辽项目。 ![图片说明]( 这左边没java ,右边都是黑色。 点击next之后 ![图片说明]( 就这样,一片空白.

PHP Xdebug Netbeans断点

<div class="post-text" itemprop="text"> <p>After working fine, with no config changes for months xdebug/netbeans is now useless. I can create breakpoints but whenever it has 'stepped in' to a further scope its impossible to step thru and simply jumps out of the inner scope to the caller. There are no exceptions generated.</p> <p>Using tail -f xdebug.log shows breakbpoints being correctly created / removed, Netbeans failed to remove from Ubuntu Software Centre, however I reinstalled over the top of existing. This does not seem clean as Netbeans remembered settings.</p> <h2>Latest steps:</h2> <p>Ran instructions at <a href="" rel="nofollow noreferrer"></a> and rebooted webserver Of note here it recommended install of xdebug-2.4.1 instead of previously 2.4.0 however this made no difference to current state of NetB / Xdebug combo. I checked php-fpm ini and this correct phpized version still ?</p> <p>Ran at /usr/local/netbeans8.*</p> <p>Downloaded re-install at <a href="" rel="nofollow noreferrer"></a> (I also need Java JDK so this is ideal) Made it executable and ran installer (as sudo)</p> <pre><code>chmod +x; ./; </code></pre> <p>And nothing changes - this is very frustrating that software designers still cannot be a***d to create proper uninstallers. Still same settings prior to re-install.</p> <h2>Further</h2> <p>Closed NetBeans again</p> <pre><code>cdl /home </code></pre> <p>then check in each user dir</p> <pre><code>rm -r .netbeans rm -r NetBeansProjects </code></pre> <p>There was also a directory called nbproject near the site root directory and in the sitefiles repo which is gitted - these was removed.</p> <h2>Update</h2> <p>Now set up the project including the crap Netbeans debug 'stop at first line' and allowing watches (whats the point of these defaults in a generally used framework norm such as laravel and what is debugging without being able to look at variable values). Its now begun allowing stepping thru code but after closing debug session will now not allow access to run config. Had to close all projects and reopen. This proves that its a Netbeans issue.</p> </div>

Netbeans和PHP - 远程调试,不会遇到断点

<div class="post-text" itemprop="text"> <p>I am attempting to debug a site (hosted on a remote server) from my local machine. I have xdebug installed on the remote machine and enabled remote debugging and auto start options for the xdebug extension.</p> <p>In some ways it appears to make a connection, the site loads fine, the "debug" icon to right of the browser's search bar is highlighted, and the "styled" error messages even appear. However, it absolutely will not stop at any breakpoints.</p> <p>I would greatly appreciate any guidance.</p> <p>Relevant parts of php.ini (on the remote server)</p> <pre><code>; This setting is on by default. report_zend_debug = 1 zend_extension = C:\Program Files\PHP\v5\ext\php_xdebug-2.4.1-5.6-vc11.dll [PHP_XDEBUG-2.4.1-5.6-VC11] xdebug.remote_enable=1 xdebug.remote_autostart = "On" xdebug.remote_port=9000 </code></pre> <p>Previously, before I put the applications on a remote server, the debugging worked fine. I have done some looking around and reading up on how it should be done, but with no success.</p> </div>


今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...



和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...


“亚马逊丛林里的蝴蝶扇动几下翅膀就可能引起两周后美国德州的一次飓风……” 这句人人皆知的话最初用来描述非线性系统中微小参数的变化所引起的系统极大变化。 而在更长的时间尺度内,我们所生活的这个世界就是这样一个异常复杂的非线性系统…… 水泥、穹顶、透视——关于时间与技艺的蝴蝶效应 公元前3000年,古埃及人将尼罗河中挖出的泥浆与纳特龙盐湖中的矿物盐混合,再掺入煅烧石灰石制成的石灰,由此得来了人...






提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...




私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...


今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...


本文介绍一些C++的两个新特性,它们虽然微小,但对你的编程十分重要 一、Template表达式内的空格 C++11标准之前建议在“在两个template表达式的闭符之间放一个空格”的要求已经过时了 例如: vector&lt;list&lt;int&gt; &gt;; //C++11之前 vector&lt;list&lt;int&gt;&gt;; //C++11 二、nullptr ...


场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...



离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...


不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...




当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...


HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...



面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?







已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...



《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)





作者 | 伍杏玲出品 | CSDN(ID:CSDNnews)格子衬衫、常掉发、双肩包、修电脑、加班多……这些似乎成了大众给程序员的固定标签。近几年流行的“跨界风”开始刷新人们对程序员的...






不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...