News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

64-bit register values and SIMD

Started by bootstrap, February 21, 2012, 05:17:38 AM

Previous topic - Next topic

bootstrap

I'm writing and debugging 64-bit applications in both C and assembly language with the codeblocks IDE on ubuntu, but the registers only display 32-bits.  The IDE is smart enough to realize it is a 64-bit mode program, since it calls the registers "rax, rbx, rcx, rdx, rsi, rdi, rbp, rsp, r8, r9, r10, r11, r12, r13, r14, r15, rip...", BUT it only displays a 32-bit value for the contents of the registers.  The strange part is, the integer values seem to display values beyond the limit of 32-bit numbers, but the hexadecimal values never exceed 32-bit values... so I can't read addresses in registers!  Ouch!

Also, I'm writing a lot of SIMD assembly language now, complete with AVX and FMA4 and other up-to-date features... but the SIMD registers are not displayed!  That's a huge bummer.  Why are registers ymm0 ~ ymm15 missing?

Oh, one other extremely annoying aspect of the IDE is... the variables are not displayed in any obvious order.  They should be displayed in alphabetic order.  As it is now, it takes me FOREVER to find specific variables in large functions.  Very annoying!

Still, I love codeblocks... it's just missing a few very basic capabilities and features.

MortenMacFly

...version, platform please? Did you try the debugger branch?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

bootstrap

Quote from: MortenMacFly on February 21, 2012, 07:03:36 AM
...version, platform please? Did you try the debugger branch?

I think I have the latest binary build for "64-bit ubuntu 10.04 LTS".

When I select "help -> about" in the codeblocks IDE, it displays a dialog that says:

10.05

and underneath that it says in smaller text:

Build: May 27 2010, 11:01:42 - wx2.8.10 (Linux, unicode) - 64-bit.


What is a "debugger branch"?


bootstrap

#4
Quote from: Alpha on February 22, 2012, 03:47:21 AM
Quote from: bootstrap on February 21, 2012, 09:58:37 PM
What is a "debugger branch"?
http://forums.next.codeblocks.org/index.php/topic,15947.0.html

This is all rather greek to me.  So let me ask this question (taken from the link you provided above).  To get newer updated versions of linux64 codeblocks periodically (nightly builds or something like that), I should put the following into my ubuntu64 /etc/apt/sources.list file:

deb http://apt.jenslody.de/ any dbg
deb-src http://apt.jenslody.de/ any dbg


Then when I update my system it will install the new version?  Or what?

PS:  I still don't know what a "debugger branch" is?  How is that different from the latest "nightly build"?

Jenna

Quote from: bootstrap on February 23, 2012, 01:49:03 AM
Quote from: Alpha on February 22, 2012, 03:47:21 AM
Quote from: bootstrap on February 21, 2012, 09:58:37 PM
What is a "debugger branch"?
http://forums.next.codeblocks.org/index.php/topic,15947.0.html

This is all rather greek to me.  So let me ask this question (taken from the link you provided above).  To get newer updated versions of linux64 codeblocks periodically (nightly builds or something like that), I should put the following into my ubuntu64 /etc/apt/sources.list file:

deb http://apt.jenslody.de/ any dbg
deb-src http://apt.jenslody.de/ any dbg


Then when I update my system it will install the new version?  Or what?
Yes, this should work.
Normally, my repo gets more often updated as the windows nightlies.
But you should also read the notes for ubuntu users on my server .

Quote from: bootstrap on February 23, 2012, 01:49:03 AM

PS:  I still don't know what a "debugger branch" is?  How is that different from the latest "nightly build"?
A branch with many new debugger features, that will be merged back into trunk in the (more or less) near future.
All other features are normally in sync with trunk.

bootstrap

Okay, I followed your instructions jens, and it did install svn7844 and wx2.8.12 and it does execute.

Unfortunately, I don't see that it fixed my problems.  Are my problems fixed yet and I don't see it (or need to select something somewhere), or are they not fixed?

PS:  The new version often doesn't display anything in the disassembly window when at a breakpoint while the old version did.  Is that a new bug?

Jenna

7844 is not the debugger branch, as you have written yourself (highlighting by me):
Quote from: bootstrap on February 23, 2012, 01:49:03 AM
[...] I should put the following into my ubuntu64 /etc/apt/sources.list file:

deb http://apt.jenslody.de/ any dbg
deb-src http://apt.jenslody.de/ any dbg

[...]
you should not use the main, but the dbg section !
Revision for debugger-branch in my server is 7790 actuallly.

bootstrap

Quote from: jens on February 24, 2012, 06:40:45 AM
7844 is not the debugger branch, as you have written yourself (highlighting by me):
Quote from: bootstrap on February 23, 2012, 01:49:03 AM
[...] I should put the following into my ubuntu64 /etc/apt/sources.list file:

deb http://apt.jenslody.de/ any dbg
deb-src http://apt.jenslody.de/ any dbg

[...]
you should not use the main, but the dbg section !
Revision for debugger-branch in my server is 7790 actuallly.
Yikes, confusion!

Okay, I changed "any main" to "any dbg" in my /etc/apt/sources.list file and executed "sudo apt-get update".  That seemed to work, meaning it seemed to download and do its things, but when I run codeblocks it still runs the version I got yesterday (svn 7844).  Why is that?  Do I have two versions of codeblocks on my system somewhere?  A "find" command doesn't find anything that looks likely.

Jenna

apt-get update does not update the software, it only updates the package cache.
By the way, debugger-branch is now 7845.

You can try apt-get upgrade to update your system, but I recommend a package manager with a gui, like synaptic .

bootstrap

Quote from: jens on February 25, 2012, 09:03:58 AM
apt-get update does not update the software, it only updates the package cache.
By the way, debugger-branch is now 7845.

You can try apt-get upgrade to update your system, but I recommend a package manager with a gui, like synaptic .

When I run codeblocks it says "svn7844" in the startup dialog and in the "help->about" dialog.

However, the register window still only displays 32-bit hexadecimal values for the registers, though the decimal values do reflect the full 64-bit values.  However, the decimal values aren't much use for looking for bits and bit-fields, or for displaying address ranges in memory.  Are you saying this SHOULD be fixed in svn7844, but I'm the only one it doesn't work for?

However, I still have the NEW problem that the disassembly window doesn't display anything when I "run to cursor" or "single step".  However, the disassembly window DOES fill up with contents when I "step into" a function.  I never had a problem with the disassembly window in the original vanilla 10.05 release.

oBFusCATed

#11
If you have "Settings -> Debugger..." and "Debug->Active debuggers" menus then you have the debugger's branch version.

About the bugs:
1. Yes, it seems the cpu registers window uses 32 bit numbers for the hex values
2. You'll have to show a simple example code and the exact steps, so we can reproduce the disassembly problem. It seems to work correctly here.

Edit:

Index: src/src/cpuregistersdlg.cpp
===================================================================
--- src/src/cpuregistersdlg.cpp (revision 7856)
+++ src/src/cpuregistersdlg.cpp (working copy)
@@ -66,7 +66,7 @@
     }

     wxString fmt;
-    fmt.Printf(_T("0x%x"), (size_t)value);
+    fmt.Printf(_T("0x%lx"), /*(size_t)*/value);
     m_pList->SetItem(idx, 1, fmt);
     fmt.Printf(_T("%lu"), value);
     m_pList->SetItem(idx, 2, fmt);


This patch seems to fix it, I've tried it on 64bit linux only.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Jenna

Quote from: bootstrap on February 27, 2012, 09:06:39 AM
When I run codeblocks it says "svn7844" in the startup dialog and in the "help->about" dialog.
Quote from: jens on February 24, 2012, 06:40:45 AM
7844 is not the debugger branch, as you have written yourself (highlighting by me):
Quote from: bootstrap on February 23, 2012, 01:49:03 AM
[...] I should put the following into my ubuntu64 /etc/apt/sources.list file:

deb http://apt.jenslody.de/ any dbg
deb-src http://apt.jenslody.de/ any dbg

[...]
you should not use the main, but the dbg section !
[...]
Quote from: jens on February 25, 2012, 09:03:58 AM
By the way, debugger-branch is now 7845.

But if I understand oBFusCATed correctly it does not work there at the moment.

bootstrap

Looks like now I can't figure out how to make ubuntu64 install the debug branch.  I *have* replaced those lines in the sources.list file and updated, but I guess I still have the main branch.  Is it now impossible to get the debug branch due to version numbering or something?

As for the disassembly window not showing contents, I generally start running with "run to cursor".

Another question.  Is it supposed to be possible to change register values while at a breakpoint?  I can't seem to find a way, but other debuggers I've seen (and written) allow that.

When I ran synaptic, I couldn't figure out how to get it to do anything sensible.  Any simpler ways that actually (horror) becoming expert at synaptic.

oBFusCATed

Quote from: bootstrap on February 27, 2012, 12:31:45 PM
As for the disassembly window not showing contents, I generally start running with "run to cursor".
Exact steps, please, but first make sure you have the debugger's branch. There were some fixes in regard to the disassembly.

Quote from: bootstrap on February 27, 2012, 12:31:45 PM
Another question.  Is it supposed to be possible to change register values while at a breakpoint?  I can't seem to find a way, but other debuggers I've seen (and written) allow that.
In debugger's branch you can execute gdb commands, there is an entry box at the bottom of the debugger log.
Only you'll have to learn what are the exact gdb commands. I guess there is a room for improvement here :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]