What does "\ b" mean in the output line of the gdb line?

When I issue the p buf command in a buf buffer that contains non-printable characters, I usually get octal output when gdb tries to print a non-printable character.

However, this time I got a line like this.

 foobar\341\204\004\b\357\373\377\277 

What does \b mean here?

+4
source share
2 answers

\b is the backspace character ( \010 if you use ASCII).

Here are the remaining escape sequences, as defined by the C standard (5.2.2 Character Character Semantics):

2 Alphabetical escape sequences representing non-graphic characters when performing a character set are designed to create actions on display devices as follows:

\a (warning) Produces an audible or visible warning without changing the active position.

\b (backspace) Moves the active position to the previous position on the current line. If the active position is in the initial position of the line, the display behavior of the device is not defined.

\f (form feed) Moves the active position to its original position at the beginning of the next logical page.

\n (new line) Moves the active position to the starting position of the next line.

\r (carriage return) Moves the active position to the original position of the current line.

\t (horizontal tab) Moves the active position to the next horizontal tab position on the current line. If the active position is on the last or last horizontal end of the tab position, the behavior of the display device is not defined.

\v (vertical tab) Moves the active position to the starting position of the next vertical tab stop. If the active position is at or after the last determined vertical tab position, the behavior of the display device is not defined.

+5
source

\b denotes the ASCII character of the inverse space (whose code is 8 or \010 in octal format)

+2
source

All Articles