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 3232814
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:12:17+00:00 2026-05-17T17:12:17+00:00

When I use set logging on in gdb, the output to the log file

  • 0

When I use set logging on in gdb, the output to the log file has a different format than what I see on the terminal screen. The logfile is not very readable. How can I get the log file in a readable format?

Output to screen is fine:

(gdb) p foo
$1 = {
  static npos = 18446744073709551615,
  _M_dataplus = {
    <std::allocator<char>> = {
      <__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
    members of std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Alloc_hider:
    _M_p = 0x601028 "Hello World!\n"
  }
}

Output to log file is not very readable:

^Z^Zpost-prompt

^Z^Zbreakpoints-headers

^Z^Zfield 0
Num     
^Z^Zfield 1
Type           
^Z^Zfield 2
Disp 
^Z^Zfield 3
Enb 
^Z^Zfield 4
Address            
^Z^Zfield 5
What

^Z^Zbreakpoints-table

^Z^Zrecord

^Z^Zfield 0
1       
^Z^Zfield 1
breakpoint     
^Z^Zfield 2
keep 
^Z^Zfield 3
y   
^Z^Zfield 4
0x0000000000400961 
^Z^Zfield 5
in main at test.cpp:9
        breakpoint already hit 1 time

^Z^Zbreakpoints-table-end

^Z^Zpost-prompt

^Z^Zvalue-history-begin 1 -
$1 = 
^Z^Zvalue-history-value
{

^Z^Zfield-begin -
static npos
^Z^Zfield-name-end
 = 
^Z^Zfield-value
18446744073709551615
^Z^Zfield-end
, 

^Z^Zfield-begin -
_M_dataplus
^Z^Zfield-name-end
 = 
^Z^Zfield-value
{
    <std::allocator<char>> = {
      <__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
    members of std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Alloc_hider: 

^Z^Zfield-begin *
_M_p
^Z^Zfield-name-end
 = 
^Z^Zfield-value
0x601028 "Hello World!\n"
^Z^Zfield-end

  }
^Z^Zfield-end

}

^Z^Zvalue-history-end

^Z^Zpost-prompt

^Z^Zbreakpoints-headers

^Z^Zfield 0
Num     
^Z^Zfield 1
Type           
^Z^Zfield 2
Disp 
^Z^Zfield 3
Enb 
^Z^Zfield 4
Address            
^Z^Zfield 5
What

^Z^Zbreakpoints-table

^Z^Zrecord

^Z^Zfield 0
1       
^Z^Zfield 1
breakpoint     
^Z^Zfield 2
keep 
^Z^Zfield 3
y   
^Z^Zfield 4
0x0000000000400961 
^Z^Zfield 5
in main at test.cpp:9
        breakpoint already hit 1 time

^Z^Zbreakpoints-table-end

^Z^Zpost-prompt
  • 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-05-17T17:12:18+00:00Added an answer on May 17, 2026 at 5:12 pm

    You must be using this from some kind of IDE, which turns on MI (machine interface). The output you see is made for easy parsing by another program, but not for human consumption.

    It is likely a bug that MI interface also affects the format of gdb.txt log. Please file a bug about it here.

    As a workaround, run GDB outside of the IDE to collect easy to read gdb.txt.

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

Sidebar

Related Questions

No related questions found

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.