Bug 60670 - Changing debugger default output radix
Summary: Changing debugger default output radix
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: CPP Debugger (show other bugs)
Version: git master
Platform: RedHat Enterprise Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
: 68064 73666 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-07-03 06:24 UTC by Jon Smirl
Modified: 2005-06-08 16:13 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
cvs diff against v1.62 of gdbcontroller.cpp (1.08 KB, patch)
2004-02-15 01:05 UTC, Robert Gruber
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Smirl 2003-07-03 06:24:47 UTC
Version:           cvs (using KDE KDE 3.1)
Installed from:    RedHat RPMs

There should be an option for defaulting 'set output-radix 16' when starting the debugger. Another neat trick would be to have the tool tip values in the watch window display in hex if default is decimal or the other way around. I am always using calc to convert into whatever is appropriate for the variable.
Comment 1 John Birch 2003-07-26 11:04:50 UTC
Add watch variable like so 
/F varname 
which is using a gdb output format (/F) 
 
see gdb info page on "Output Format" 
 
two useful ones for your situation from the gdb info page are 
 
x - Regard the bits of the value as an integer, and print the integer in 
hexadecimal. 
a -  Print as an address, both absolute in hexadecimal and as an offset 
     from the nearest preceding symbol.  You can use this format used 
     to discover where (in what function) an unknown address is located: 
 
          (gdb) p/a 0x54320 
          $3 = 0x54320 <_initialize_vx+396> 
 
It would be nice to add this to the interface in a more user friendly manner, 
but I have no time at the moment. I can point someone in the right direction if 
they contact me. 
Comment 2 Reinhold Kainhofer 2003-09-07 16:48:24 UTC
Subject: kdepim/korganizer

CVS commit by kainhofe: 

Finally, I found the real problem that crashed korganizer when you marked a todo completed using the checkbox. The problem was that stateChange of the KOTodoViewItem emitted the signal todoChanged, which called updateTodoViews(), which rebuilt the todo lists. This meant also calling stateChange of the same item again, and then the crash occured.

The fix is to postpone the updateViews until the stateChange function has exited. So, I'm now using QTimer::singleShot to call that slot. 

Also, moved the connect calls for the todo list and the todo view to KOViewManager, so the two todo lists are always connected to the same signals/slots.

Also, now that marking todo items finished worked again, I could finally test my patch for unding this action. It works, so now bug 60670 is fixed.

CCMAIL: 60670-done@bugs.kde.org, 56348@bugs.kde.org, tokoe@kde.org



PS: The way bug 56348 (the crash which i finally fixed now) was closed (revision 1.36 of http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdepim/korganizer/koviewmanager.cpp ) collides with item 12 of the CVS Policies (http://developer.kde.org/policies/commitpolicy.html#12)...


  M +8 -25     calendarview.cpp   1.214
  M +1 -1      kotodoview.h   1.56
  M +31 -22    koviewmanager.cpp   1.42
  M +7 -5      koviewmanager.h   1.12



Comment 3 Reinhold Kainhofer 2003-09-07 17:02:25 UTC
Oops, closed wrong bug (60670 instead of 60760). Reopening it
Comment 4 Jon Smirl 2003-12-05 20:41:59 UTC
This is an very annoying issue in the debugger. People who know enough about GDB can work around it with 'set output-radix 16'. But even that has problems, for example I am stopped on a line with a bug. I change the output radix. But the only way to make the display update to the new radix is to step a line. But I don't want to step a line. So I end up using calc to overcome the debugger deficency.

Correct solution is for a right click item or menu choice on the watch window to flip between hex and decimal display.

I don't really agree that this is a wish item. Every other debugger I've used can flip between hex and decimal display.
Comment 5 Jon Smirl 2003-12-17 20:00:40 UTC
68064 is a dup of this
Comment 6 Jens Dagerbo 2003-12-17 20:09:46 UTC
*** Bug 68064 has been marked as a duplicate of this bug. ***
Comment 7 Jens Dagerbo 2004-01-28 14:31:44 UTC
*** Bug 73666 has been marked as a duplicate of this bug. ***
Comment 8 John Birch 2004-02-06 02:57:44 UTC
Committed a nice patch from Robert Gruber which adds this functionality. Right mouse click on watch variable to access the hex/dec toggle option for this watch variable.
Also commited global output radix option for the debugger that affects all output. See debugger options.

Jon, you are right that "set output radix 16" doesn't refresh the screen when you type it in the gdb window, but doesn't switching between frames refresh the watch vars? (I can't remember). Might be a work around.

Two things left to do on this before it's closed
. kdevelop sends "whatis /x varname" when a watch var is in hex mode. This is incorrect - it should send "whatis varname" (an existing bug and NOT caused by Robert's patch I might add :-)
. changing the output radix globally doesn't refresh the current output. It should.

Possibly we should also add octal to the RMB on the watchvar (but how many will want it hmmm?)
Comment 9 John Birch 2004-02-06 03:06:09 UTC
This is from the gdb mailing list.

Do we want to worry about this?

>>  It seems in GNU gdb Red Hat Linux (5.1-1) when
>>  I do a print /x the order is Big Endian regardless
>>  of the host architecture.
> 
> The print command just prints a value, and values don't have endianess.
> Only memory contents have.

"Indeed.  If you want to see endianness, use 'x' instead, and ask it for a 
string of hex bytes.  :^) "
Comment 10 John Birch 2004-02-08 04:12:13 UTC
Added new patch from Robert Gruber which fixes the previous "two things" plus fixes another two things.

However I see two more problems.
. toggle a variable within and expanded structure send an incorrect command to gdb
eg "print about./x varname" shouldbe "print /x about.varname"
. stepping with /x modifier caused red text in watch window even though the variable values hasn't changed.
Comment 11 Robert Gruber 2004-02-15 01:05:21 UTC
Created attachment 4697 [details]
cvs diff against v1.62 of gdbcontroller.cpp

hi,
this patch fixes the bug when toggling a variable within an expanded structure.
John, can you please commit it.

Robert


BTW: I also thought about the problem when stepping with a /x modified
variable, but I don't see a chance to fix it. Anybody a good idea?
Comment 12 Jon Smirl 2005-06-08 16:13:05 UTC
*** Bug has been marked as fixed ***.