Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9210789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:09:26+00:00 2026-06-18T01:09:26+00:00

I have an array of characters with about 100k entries. It seems like when

  • 0

I have an array of characters with about 100k entries. It seems like when in the function I
print *buffer it is getting cut off prematurely. is there anything I can do to lengthen the amount of characters gdb will print to console? If not, can I print this variable to file? I tried to use the dump commands, but couldnt seem to come up with the right thing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:09:27+00:00Added an answer on June 18, 2026 at 1:09 am
    (gdb) help x
    Examine memory: x/FMT ADDRESS.
    ADDRESS is an expression for the memory address to examine.
    FMT is a repeat count followed by a format letter and a size letter.
    Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal),
      t(binary), f(float), a(address), i(instruction), c(char) and s(string).
    Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).
    The specified number of objects of the specified size are printed
    according to the format.
    
    Defaults for format and size letters are those previously used.
    Default count is 1.  Default address is following last thing printed
    with this command or "print".
    (gdb) x/8b array
    0xbffd7670:     0       0       0       0       0       0       0       0
    (gdb) x/16b array
    0xbffd7670:     0       0       0       0       0       0       0       0
    0xbffd7678:     0       0       0       0       0       0       0       0
    (gdb) x/128b array
    0xbffd7670:     0       0       0       0       0       0       0       0
    0xbffd7678:     0       0       0       0       0       0       0       0
    0xbffd7680:     0       0       0       0       0       0       0       0
    0xbffd7688:     0       0       0       0       0       0       0       0
    0xbffd7690:     0       0       0       0       0       0       0       0
    0xbffd7698:     0       0       0       0       0       0       0       0
    0xbffd76a0:     0       0       0       0       0       0       0       0
    0xbffd76a8:     0       0       0       0       0       0       0       0
    0xbffd76b0:     0       0       0       0       0       0       0       0
    0xbffd76b8:     0       0       0       0       0       0       0       0
    0xbffd76c0:     0       0       0       0       0       0       0       0
    0xbffd76c8:     0       0       0       0       0       0       0       0
    0xbffd76d0:     0       0       0       0       0       0       0       0
    0xbffd76d8:     0       0       0       0       0       0       0       0
    0xbffd76e0:     0       0       0       0       0       0       0       0
    0xbffd76e8:     0       0       0       0       0       0       0       0
    (gdb)
    

    If you want the ASCII character symbols printed as well, use x/<size>c.

    (gdb) set logging file ~/gdb_dump.txt
    (gdb) set logging on
    Copying output to /home/mminich/gdb_dump.txt.
    (gdb) x/26c array
    0xbfff4b20:     97 'a'  98 'b'  99 'c'  100 'd' 101 'e' 102 'f' 103 'g' 104 'h'
    0xbfff4b28:     105 'i' 106 'j' 107 'k' 108 'l' 109 'm' 110 'n' 111 'o' 112 'p'
    0xbfff4b30:     113 'q' 114 'r' 115 's' 116 't' 117 'u' 118 'v' 119 'w' 120 'x'
    0xbfff4b38:     121 'y' 122 'z'
    (gdb) set logging off
    Done logging to /home/mminich/gdb_dump.txt.
    (gdb)
    

    BTW, I agree wholeheartedly with William Pursell’s comment under your question: “I find it much easier to define functions in the code that perform the data dump, and just call them from gdb. (Wrap the definitions in #ifdef DEBUG)”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple function which takes an array of characters as an argument,
I have an array like so array( 1=>hello, 2=>foo, 3=>192, 4=>keep characters AND digits
So I want to have a buffer with an array of structs like this:
I have an array of 4 characters, for example: char char_array[10]; char_arr[0] = 'a';
Say I have an array of arbitrary size holding single characters. I want to
Currently, I have an array of Strings, each with random characters in it that
In C#, Say you have an array of strings, which contain only characters '0'
I have a question about char array. How do I declare an array of
I have problem with latin chars, here is the code: $stopWords = array('i','a','about','an','and','are','as','at','be','by','com','de','en','for','from','how','in','is','it','la','of','on','or','that','the','this','to','was','what','when','where','who','will','with','und','the','www', 'on',
I have a String array that actually consists of Hex characters. Let's say the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.