Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* meaning of tags in output
@ 2013-04-19  6:58 Markus Teich
  2013-04-23 18:17 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Teich @ 2013-04-19  6:58 UTC (permalink / raw)
  To: gdb

Hello,

i found that some expressions give extra tags in the output when
printed. Unfortunately i did not find any documentation about them, so i
looked in the source and tried to summarize them myself.
Is there already a documented list?
Since i am only working with C-Code right now, i tried to filter, which
tags are relevant for C and which are not.
Can you help me complete/correct the list?

--Markus


<synthetic pointer>
if "this" is not used in a C++ member function it is an synthetic pointer.
irrelevant for C.

<repeats %u times>
can be omitted with 'set print elements 0'

<invalid address>
seems to be only used for Pascal and C++ source.

<error reading variable>
occurs, when a variable is printed which is not yet initialized. Is it
C++ only?

<address of value unknown>
???seems to be for errorhandling in gdb???

<internal function %s>
???

<incomplete sequence %WHATEV>
seems to only occur, when gdb interprets something as a wchar array and
finds a "half" wchar.

<unavailable>
???

<Error reading address %HEX?: %s>
could not read adress. What is the difference to the next tag?

<Address %HEX out of bounds>
Memory access on BADFOOD pointer

<invalid float value>
google hints: could be serious (stack corruption?).

<incomplete type>
occurs if e.g. type is a struct without members.

<optimized out>
compiler optimizations.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: meaning of tags in output
  2013-04-19  6:58 meaning of tags in output Markus Teich
@ 2013-04-23 18:17 ` Tom Tromey
  2013-04-23 18:53   ` Markus Teich
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2013-04-23 18:17 UTC (permalink / raw)
  To: Markus Teich; +Cc: gdb

>>>>> "Markus" == Markus Teich <markus.teich@stusta.mhn.de> writes:

Markus> Is there already a documented list?

There should be some information in the documentation.
If any are missing, we'd appreciate a patch or a bug report...

I don't think there is a complete list.  New ones are added whenever
necessary, but historically not always documented.

Markus> Since i am only working with C-Code right now, i tried to filter, which
Markus> tags are relevant for C and which are not.

If you are parsing the CLI output, you should know that MI is designed
for this.  Parsing the CLI output is always going to be fragile.

Markus> <synthetic pointer>
Markus> if "this" is not used in a C++ member function it is an
Markus> synthetic pointer.  irrelevant for C.

No, synthetic pointers are a DWARF extension typically used when the
compiler supports SRA.  GCC emits this in some cases.

Markus> <error reading variable>
Markus> occurs, when a variable is printed which is not yet initialized. Is it
Markus> C++ only?

Pretty much any error can wind up being printed this way.
I don't know of a way to categorize it.

Markus> <address of value unknown>
Markus> ???seems to be for errorhandling in gdb???

I see the code, but I don't know how this could happen.

Markus> <internal function %s>
Markus> ???

You can define internal functions in gdb; this is exposed to users via
Python.

These internal functions are represented as values with "internal
function" type.  If you try to print such a value, this is what you get.

Markus> <unavailable>
Markus> ???

I thought this one was documented, but I didn't immediately see it.

Some of a value's contents can be unavailable in some situations.
For example you might be examining saved trace data, and try to print a
register which was not traced.

Markus> <Error reading address %HEX?: %s>
Markus> could not read adress. What is the difference to the next tag?

Markus> <Address %HEX out of bounds>
Markus> Memory access on BADFOOD pointer

I see these both in val_print_string.
The difference comes from the error returned by the target code.
I don't know any more than that.

Markus> <invalid float value>
Markus> google hints: could be serious (stack corruption?).

Or, I think, an invalid bit pattern for a floating-point value.

Tom


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: meaning of tags in output
  2013-04-23 18:17 ` Tom Tromey
@ 2013-04-23 18:53   ` Markus Teich
  2013-04-24 19:09     ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Teich @ 2013-04-23 18:53 UTC (permalink / raw)
  To: gdb

Thanks for the extensive reply.

> Markus> Since i am only working with C-Code right now, i tried to filter, which
> Markus> tags are relevant for C and which are not.
>
> If you are parsing the CLI output, you should know that MI is designed
> for this.  Parsing the CLI output is always going to be fragile.

Actually i am using the MI with libgdbmi, which unfortunately is not 
actively developed anymore.
I also use varobjects and -var-evaluate-expression, but they still 
contain some tags in the output.

> Markus> <address of value unknown>
> Markus> ???seems to be for errorhandling in gdb???
>
> I see the code, but I don't know how this could happen.

If it is unreachable, it probably should be removed.

--Markus


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: meaning of tags in output
  2013-04-23 18:53   ` Markus Teich
@ 2013-04-24 19:09     ` Tom Tromey
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2013-04-24 19:09 UTC (permalink / raw)
  To: Markus Teich; +Cc: gdb

Markus> I also use varobjects and -var-evaluate-expression, but they still
Markus> contain some tags in the output.

Ok, I see.  Thanks.

I suppose with some effort gdb could emit MI attributes instead of magic
tags here.

Markus> <address of value unknown>
Markus> ???seems to be for errorhandling in gdb???

Tom> I see the code, but I don't know how this could happen.

Markus> If it is unreachable, it probably should be removed.

I actually don't know whether or not it is unreachable.

Tom


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-04-24 19:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-19  6:58 meaning of tags in output Markus Teich
2013-04-23 18:17 ` Tom Tromey
2013-04-23 18:53   ` Markus Teich
2013-04-24 19:09     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox