<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 30, 2014 at 10:41 PM, David Cournapeau <span dir="ltr"><<a href="mailto:cournape@gmail.com" target="_blank">cournape@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sun, Nov 30, 2014 at 5:45 PM, Charles R Harris <span dir="ltr"><<a href="mailto:charlesr.harris@gmail.com" target="_blank">charlesr.harris@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Sun, Nov 30, 2014 at 4:54 AM, David Cournapeau <span dir="ltr"><<a href="mailto:cournape@gmail.com" target="_blank">cournape@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi there,<div><br></div><div>I remember having seen some numpy-aware gdb macros at some point, but cannot find any reference. Does anyone know of any ?</div></div></blockquote><div><br></div></span><div>What would numpy aware gdb macros be? Never heard of them.<br></div></div></div></div></blockquote><div><br></div></div></div><div>Python itself has some gdb macros (<a href="https://wiki.python.org/moin/DebuggingWithGdb" target="_blank">https://wiki.python.org/moin/DebuggingWithGdb</a>).</div><div><br></div><div>You can do things like:</div><div><br></div><div># p is a PyObject * pointer to the list [1, 2]</div><div>> pyo p </div><div>[1, 2]</div><div><br></div><div>The idea would be to have a nice representation for arrays, dtypes, etc...</div><div><br></div><div>David</div><div><br></div></div></div></div></blockquote><div><br></div><div>this wiki entry is very very old or not aware of the official python gdb macros (which are built into gdb in typical linux distributions, no extra configuration required).<br></div><div>and the macros are awesome, they are extremely helpful in debugging python extension codes.<br>The current commands are:<br></div><div>py-list<br>py-bt<br></div><div>py-print<br>py-locals<br></div><div>py-up/py-down<br><br></div><div>having similar macros for numpy types might be useful, but at least I more often than not one does want the actual C structure than a pretty representation which is just *(type*)PyArray_DATA(arr)@10 away.<br></div></div></div></div>