This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] -stack-info-depth should always return a count.


On 03/27/2014 05:20 PM, Andrew Burgess wrote:

-^done,depth="12"
+^done,depth="12",reason="All frames"
  (gdb)
  -stack-info-depth 4
-^done,depth="4"
+^done,depth="4",reason="Reached frame limit"
  (gdb)
  -stack-info-depth 12
-^done,depth="12"
+^done,depth="12",reason="Reached frame limit"
  (gdb)
  -stack-info-depth 11
-^done,depth="11"
+^done,depth="11",reason="Reached frame limit"
  (gdb)
  -stack-info-depth 13
-^done,depth="12"
+^done,depth="12",reason="All frames"
+(gdb)
+@end smallexample
+
+An example where there are 3 valid stack frames, after which the stack
+pointer is corrupted and gdb is unable to unwind the stack further:
+
+@smallexample
+(gdb)
+-stack-info-depth
+^done,depth="3",reason="Cannot access memory at address 0xffffffff"
+(gdb)
+-stack-info-depth 4
+^done,depth="3",reason="Cannot access memory at address 0xffffffff"
+(gdb)
+-stack-info-depth 3
+^done,depth="3",reason="Reached frame limit"
  (gdb)
  @end smallexample

I think using human readable reasons like is a bit inconvenient, given that the consumer is
a computer. Can we use has_more field, like we do somewhere else, to indicate that more
frames might be available in case of specified depth limit? And use 'error' field in case
we run into actual error (in which case, has_more field will not be provided)?

Thanks,
Volodya



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]