Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » howto see assembly code? [SOLVED]
howto see assembly code? [SOLVED] [message #26] Mon, 21 November 2005 18:27 Go to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
howto see assembly code?

[Updated on: Sun, 19 March 2006 07:24]

Report message to a moderator

Re: howto see assembly code? [message #27 is a reply to message #26] Mon, 21 November 2005 18:44 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
It is always showed when debugging in the right pane. Just place breakpoint and run the app.

BTW, there is a problem with viewing release code assembly (useful when doing optimizations). I tend to solve this by placeing __BREAK__, which is essentially *(int *)0 = 0; to crash the code at the right place and invoke debugger Smile
Re: howto see assembly code? [message #51 is a reply to message #27] Tue, 22 November 2005 22:41 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
luzr wrote on Mon, 21 November 2005 18:44

*(int *)0 = 0; to crash the code at the right place and invoke debugger Smile


__asm int 3;

(MS syntax)
will probably work a tad better in such case.
(legal "hard breakpoint" without testing the stability of system's core memory protection)
Re: howto see assembly code? [message #56 is a reply to message #26] Tue, 22 November 2005 23:22 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yes, in fact that is equivalent. Does not work on linux thought.
Re: howto see assembly code? [message #64 is a reply to message #56] Wed, 23 November 2005 01:06 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
hm... calling breakpoint interrupt and rewriting memory at address 0 with 0 is really not the equivalent. INT 3 summons breakpoint interrupt in DOS (Win16/32), and after resume the thread will continue, while "*(int *)0 = 0;" does rewrite protected memory, so the thread will crash. Maybe minor difference when you want to check the code, but can be helpfull when you are just steping trough some code.

I wonder why linux does not implement (or does it?) "INT 3" as breakpoint, because AFAIK (at least in the age of 286/386/486 CPUs) int 3 is the only 1B long interrupt instruction, and the main purpose for this instruction was exactly ability to use breakpoints easily in debuggers. (at least the code should *not* crash at linux, as the INT 3 should be simple RET interrupt when no debugger is running)
Re: howto see assembly code? [message #66 is a reply to message #64] Wed, 23 November 2005 07:12 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, actually I think Linux uses int 3 as well, I was rather referring to syntax (it would need #ifdef because of assembly).

Anyway, I do not thing this is the most importatnt thing in the world. Thankfuly, all systems are able to deal with NULL assignemnt well a this is just a tool for experimenting with the code, nothing that should be left in producuction app...
Previous Topic: Can't compile console application with MS C++ Toolkit
Next Topic: ArrayCrl - compiling error
Goto Forum:
  


Current Time: Sat Apr 27 22:33:53 CEST 2024

Total time taken to generate the page: 1.97431 seconds