<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:13px"><div id="yui_3_16_0_1_1432011700805_1445971"><br></div><div id="yui_3_16_0_1_1432011700805_1445971">yes, I mean crash command line is lacking support of some advanced</div><div id="yui_3_16_0_1_1432011700805_1445971">arithmetic, like this pd command, it doesn't have to send it to gdb;</div><div id="yui_3_16_0_1_1432011700805_1445971"><br></div><div id="yui_3_16_0_1_1432011700805_1445971">BTW, these days I am looking for an advanced scripting in crash,</div><div id="yui_3_16_0_1_1432011700805_1445971" dir="ltr">does crash provide some builtin script language ?</div><div id="yui_3_16_0_1_1432011700805_1445971" dir="ltr"><br></div><div id="yui_3_16_0_1_1432011700805_1445971" dir="ltr">Or have you looked this pykdump project, to embed a python interpreter</div><div id="yui_3_16_0_1_1432011700805_1445971" dir="ltr">sounds like a good idea, since gdb has support python scripting as well,</div><div id="yui_3_16_0_1_1432011700805_1445971" dir="ltr"><br></div><div id="yui_3_16_0_1_1432011700805_1445971" dir="ltr"><a href="http://sourceforge.net/projects/pykdump/" id="yui_3_16_0_1_1432011700805_1446395">http://sourceforge.net/projects/pykdump/</a><br></div>  <div id="yui_3_16_0_1_1432011700805_1445971" class="" style=""><br class="" style=""></div><br><div class="qtdSeparateBR" id="yui_3_16_0_1_1432011700805_1446865">Thanks,<br><br></div><div class="yahoo_quoted" id="yui_3_16_0_1_1432011700805_1446863" style="display: block;"> <div style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 13px;" id="yui_3_16_0_1_1432011700805_1446862"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_1_1432011700805_1446861"> <div dir="ltr" id="yui_3_16_0_1_1432011700805_1446860"> <font size="2" face="Arial" id="yui_3_16_0_1_1432011700805_1446859"> On Wednesday, May 20, 2015 11:17 AM, Dave Anderson <anderson@redhat.com> wrote:<br> </font> </div>  <br><br> <div class="y_msg_container" id="yui_3_16_0_1_1432011700805_1446869"><br clear="none"><br clear="none">----- Original Message -----<br clear="none">> <br clear="none">> Hi Dave,<br clear="none">> Does this sound like a bug, it need right shift of the subtraction result,<br clear="none">> crash-git> pd (678324157984276 >> 32)<br clear="none">> $10 = 157934<br clear="none">> crash-git> pd ((681670518181331-678324157984276) >> 32)<br clear="none">> p: gdb request failed: p ((681670518181331-678324157984276)<br clear="none">> crash-git><br clear="none">> <br clear="none">> It might be lacking support of some advanced arithmetic, so what is a proper<br clear="none">> wayto do some arithmetic like this?<br clear="none"><br clear="none">No, it is a crash bug.  If you turn on the console mode, you can see the string<br clear="none">that is passed on to gdb.  Simple example:<br clear="none">  <br clear="none">  crash> !tty<br clear="none">  /dev/pts/8<br clear="none">  crash> set console /dev/pts/8<br clear="none">  debug console [2850]: /dev/pts/8<br clear="none">  console: /dev/pts/8<br clear="none">  crash> set debug 1<br clear="none">  debug: 1<br clear="none">  crash><br clear="none">  <br clear="none">The simple shift case works, and you can see the string that gets passed <br clear="none">to gdb on the 2nd line of output, in the bracket after gdb_pass_through:<br clear="none">  <br clear="none">  crash> pd (15 >> 1)<br clear="none">  error() trace: 467e99 => 51c147 => 518ca6 => 46eaff<br clear="none">  gdb_pass_through: [p (15 >> 1)]<br clear="none">  p: per_cpu_symbol_search((15 >> 1)): NULL<br clear="none">  $9 = 7<br clear="none">  crash><br clear="none">  <br clear="none">But by adding the internal set of parentheses, the string gets<br clear="none">clipped, and just "p ((15+1)" gets passed to gdb:<br clear="none">  <br clear="none">  crash> pd ((15+1) >> 1)<br clear="none">  error() trace: 467e99 => 51c147 => 518ca6 => 46eaff<br clear="none">  p: per_cpu_symbol_search(((15+1)): NULL<br clear="none">  gdb_pass_through: [p ((15+1)]<br clear="none">  error() trace: 467e99 => 51c1e7 => 51a7d5 => 46eaff<br clear="none">  p: gdb request failed: p ((15+1)<br clear="none">  crash> <br clear="none"><br clear="none">So it's either related to the crash command line redirection code, <br clear="none">or in the process_gdb_output() function.  (Feel free to debug it<br clear="none">if you have the time...)<br clear="none"><br clear="none">Thanks,<div class="yqt0871163427" id="yqtfd75579"><br clear="none">  Dave<br clear="none"></div><br><br></div>  </div> </div>  </div></div></body></html>