debugging

Why does intellij idea not kill the debug process immediately?

不想你离开。 提交于 2020-01-01 08:52:39
问题 I'm using idea 2016.1.1 and wonder why idea does not kill the debug process immediately when I click the stop button. E.g. use this piece of code to reproduce it public class Main { public static void main(String[] args) { int i = 0; while (true) { i++; System.out.print("I'm still alive: "); System.out.println(i); } } } Set a breakpoint before the loop begins. Start a debugging session, wait until it breaks and press the red stop button (CTRL-F2). I would expect that the process is stopped

Visual Studio 2012 RC breaks on exceptions from within the .NET Framework. How do I make it break on exceptions only in my code?

99封情书 提交于 2020-01-01 08:48:27
问题 When debugging using Visual Studio 2012 RC with break on exception turned on, Visual Studio breaks on exceptions from within the .NET Framework. How do I make it break on exceptions only in my code? When debugging a ASP.NET MVC 4 project there are a lot of framework exceptions thrown on every page hit. The following exception happens a lot: System.Globalization.CultureNotFoundException occurred HResult=-2147024809 Message=Culture is not supported. Parameter name: name UserCache is an invalid

Google Chrome debugger skip breakpoint

本秂侑毒 提交于 2020-01-01 08:43:49
问题 I am currently trying to debug a js script in chrome, I put a breakpoint in the script and it breaks properly when I use only one tab, but on a second tab it doesn't break even though I see the break point in the code. 回答1: Did you use the pretty print option when viewing the source: I have noticed that the formatted copy can get out of sync. I remove all of the breakpoints, close both the formatted tab and the original tab (in sources), then open the original, click the pretty print option,

Get reference to the current exception

爱⌒轻易说出口 提交于 2020-01-01 08:39:11
问题 $ ./runtests.py -v tests/managers/test_customer.py:CustomerManagerTest.test_register_without_subscription --ipdb ... test_register_without_subscription (tests.managers.test_customer.CustomerManagerTest) ... - TRACEBACK -------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.7/unittest/case.py", line 331, in run testMethod() File "*****/tests/managers/test_customer.py", line 198, in test_register_without_subscription 1/0

Break the debugger on assertion failed

混江龙づ霸主 提交于 2020-01-01 08:05:11
问题 Is there a way to break the debugger when assertion is false and running the application using Visual Studio debugger. Earlier when I was debugging Windows application I would get an exception and the debugger would break, but now on Smart Device an assertion failed window is showed with stack trace, but I would also like to see variable values etc. 回答1: Stupid me, the solution was simple. When the window pops out, press pause in debugger :) 回答2: Not sure about VS 2008, but in at least 2010

404 error with open-uri in a rake task… what's causing it?

北战南征 提交于 2020-01-01 08:04:09
问题 I have a rake task that fetches JSON data from an API, parses it, and saves it to the database: task :embedly => :environment do require 'json' require 'uri' require 'open-uri' Video.all.each do |video| json_stream = open("http://api.embed.ly/1/oembed?key=08b652e6b3ea11e0ae3f4040d3dc5c07&url=#{video.video_url}&maxwidth=525") ruby_hash = JSON.parse(json_stream.read) thumbnail_url = ruby_hash['thumbnail_url'] embed_code = ruby_hash['html'] video.update_attributes(:thumbnail_url => thumbnail_url

404 error with open-uri in a rake task… what's causing it?

情到浓时终转凉″ 提交于 2020-01-01 08:04:09
问题 I have a rake task that fetches JSON data from an API, parses it, and saves it to the database: task :embedly => :environment do require 'json' require 'uri' require 'open-uri' Video.all.each do |video| json_stream = open("http://api.embed.ly/1/oembed?key=08b652e6b3ea11e0ae3f4040d3dc5c07&url=#{video.video_url}&maxwidth=525") ruby_hash = JSON.parse(json_stream.read) thumbnail_url = ruby_hash['thumbnail_url'] embed_code = ruby_hash['html'] video.update_attributes(:thumbnail_url => thumbnail_url

Roslyn scripting: Line number information for run time exceptions

非 Y 不嫁゛ 提交于 2020-01-01 07:04:35
问题 I am messing around with the Roslyn scripting stuff (using the Microsoft.CodeAnalysis.CSharp.Scripting nuget package), and I wonder if there is a way to add line number information to the stack traces for exceptions that happen inside a script. When I run the following C# code: // using Microsoft.CodeAnalysis.CSharp.Scripting; var code = @" var a = 0; var b = 1 / a; "; try { await CSharpScript.RunAsync(code); } catch (DivideByZeroException dbze) { Console.WriteLine(dbze.StackTrace); } The

Call Stack at Runtime

霸气de小男生 提交于 2020-01-01 05:52:20
问题 I want to access the call stack at runtime in a Native C++ application. I am not using the IDE. How do I display the call stack? Update: I have a function which is called from many points all over the application. It crashes on rare occasions. I was looking for a way to get name of the caller and log it. 回答1: I believe that this page has the answer you are looking for. You said Visual C so I assume you mean windows. 回答2: Have a look at StackWalk64. If you're used to doing this on .NET, then

Call Stack at Runtime

 ̄綄美尐妖づ 提交于 2020-01-01 05:52:08
问题 I want to access the call stack at runtime in a Native C++ application. I am not using the IDE. How do I display the call stack? Update: I have a function which is called from many points all over the application. It crashes on rare occasions. I was looking for a way to get name of the caller and log it. 回答1: I believe that this page has the answer you are looking for. You said Visual C so I assume you mean windows. 回答2: Have a look at StackWalk64. If you're used to doing this on .NET, then