Question:
what is a debugger? Are debuggers for all languages same?
2012-06-07 09:09:55 UTC
if a binary file is made by batch programming and another by c or java........can a debugger show the assembly code for all (if it shows assembly code)? if not how will it display the codes?
Three answers:
2012-06-07 09:13:12 UTC
A debugger is a computer program that assists in the detection and correction of errors in computer programs.



There are debuggers for Java and debuggers for native code.



A java debugger or disassembler will not show assembler code, only native code is converted into assembler such as c, c++, delphi, pascal, fortan, assembler, etc



You can view java source code by using the tool jd-gui which is a java decompiler.

You can view c++ code through ollydbg, which can debug native code. (assembler)

You cannot debug a batch file, batch files do not make binary files as they are scripts, you can view the source through notepad



It displays the code by viewing hexadecimal numbers and converting those into instructions.



Since java is a virtual machine, let's say 123 is add 1 to register.



So 0x123 will be : reg1 += 1 in java. (HYPOTHETICAL)



Assembler instruction NOP is 0x90, jump short is 0xEB, etc



If the debugger see's 0x90 0xE9 0x12 it will instantly know that:



0x90 = nop

0xE9 = jmp short, following byte is length

0x12 = jump 12 forward



It knows because everything is already predefined, like the gravity constant is g = 9.80 on earth (not exact to the decimal) and the constant pi is 3.14159
James Bond
2012-06-07 22:01:36 UTC
Debuggers are also called as interpreters. They are used to identify run time errors(also called as bugs) which are otherwise difficult to identify.They contain facilities such as inspecting a variable value, register values etc (known as tracing) which a program is running. Usually when a run time error occures it is reported in terms of machine language which is some what difficult to understand. By using debuggers we can map the same to our source code and then fix.



gdb is popular debugger with excellent features
2016-12-10 19:15:38 UTC
the 1st guy is suggesting a distinctive programming language and regrettably has no thought what he's conversing approximately and positively no suitable to be providing you with tips. i'm uncertain what you're asking on your question because plainly to invite 2 fairly some issues. First, you choose to comprehend in case you are able to print to the demonstrate without calling a print fact. that's, of course, no longer fairly accomplished as you may could edit the approach of the console to control the text fabric interior the console. attempting to get admission to information outdoors of your software's scope isn't allowed via the working gadget so some significant hack artwork may be in contact. then you definately ask in case you are able to print to the demonstrate in C without printf()... particular, in case you utilize yet another function. How approximately... fprintf()? fprintf(stdout, "hi"); you're able to be employing fprintf() over printf() besides. with the aid of fact the 2nd poster suggested, there are different a thank you to jot down text fabric to the demonstrate.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...