LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-30-2010, 11:43 PM   #1
gung
LQ Newbie
 
Registered: Apr 2010
Location: Virginia
Distribution: Ubuntu
Posts: 4

Rep: Reputation: 0
How do I get a simple hex dump in gdb


While using gdb to debug a C++ program.
What I'd like is to be able to enter an address (or an expression yielding an address), and a size, and have it simply do a hex dump. Or maybe even like:

aaaaaaaa 7473839298 29873479898734 this du mp is fa
aaaaaaab 8298...... .............. ke

(I just made up the hex digits above, and didn't even count columns. But you get the idea)

I'm actually using DDD, so a GUI solution is also acceptable.

Thx,
DaveA
 
Old 04-30-2010, 11:52 PM   #2
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,622
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
Hi,
See if the following link helps you somehow !
http://www.delorie.com/gnu/docs/gdb/gdb_69.html
 
Old 05-02-2010, 08:03 AM   #3
gung
LQ Newbie
 
Registered: Apr 2010
Location: Virginia
Distribution: Ubuntu
Posts: 4

Original Poster
Rep: Reputation: 0
Yes, that helped. It got me back to the gdb docs, and close to an appropriate page[1]. The command I should be using is

x /20xb expr

where the x command is different than the p command I'd been using. This gives me the hex values for an arbitrary range of bytes. it also works with /xh /xw /xg for other data sizes.

thanks.
DaveA

[1] http://www.delorie.com/gnu/docs/gdb/gdb_56.html
 
Old 05-02-2010, 11:38 PM   #4
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,622
Blog Entries: 29

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
Its nice you could solve your problem,

You can mark the thread SOLVED if you think you have got an answer to your problem through the Thread tools menu at the top of this page !
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nonzero characters in hex dump after zeroing drive mazinoz Linux - Server 4 04-06-2010 01:47 AM
LXer: Doing a Reverse Hex Dump LXer Syndicated Linux News 0 06-03-2008 02:50 AM
strange hex dump of floppy Berhanie Linux - General 2 02-07-2004 11:53 AM
gdb assembly dump centr0 Programming 3 07-07-2003 11:38 AM


All times are GMT -5. The time now is 05:29 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration