Compile and debug CPP commands on AIX

Source: Internet
Author: User

Code:

#include <stdio.h>int main(){        int a = 0x414243;        printf("%d\n", 1);        return 0;}

To compile and link:
Xlc_r-g-o Test test. cpp

To debug:
Dbx./test

Type 'help' for help.
Reading symbolic information...
(DBX) File
Test. cpp
(DBX) Stop in main
[1] Stop in main
(DBX) Run
[1] stopped in main at line 5 ($ T1)
5 Int a = 0x414243;
(DBX) N
Stopped in main at line 7 ($ T1)
7 printf ("% d \ n", 1 );
(DBX) P
4276803
(DBX) P &
0x2ff22470
(DBX) & A/X; X prints long integer characters in hexadecimal format.
0x2ff22470: 00414243
(DBX) & A, & A + 3/h; H prints bytes in hexadecimal notation.
0x2ff22470: 00 41 42 43
(DBX)

 

==================================

View memory:

Address, address/[mode] [> file]
Address/[count] [mode] [> file]
If the mode variable is omitted, the method previously specified is reused. The initial mode is X. The following methods are supported:

B prints bytes in octal.
C prints bytes as characters.
D. Print the long integer in decimal format.
D. Print the short integer in decimal format.
F print the single-precision floating point number.
G prints double-precision floating point numbers.
H prints bytes in hexadecimal format.
I printer commands.
LLD prints 8 bytes of signed decimal number.
LLO prints 8 bytes of unsigned eight bytes.
LlU prints 8 bytes of unsigned decimal number.
LLX prints 8 bytes of unsigned hexadecimal number.
O print long integer characters in octal.
O print short integer characters in octal.
Q: print the Extended Floating Point Number.
S prints the string terminated by NULL bytes.
X prints long integer characters in hexadecimal format.
X prints short integer characters in hexadecimal format.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.