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: [python][patch] Add GDB Parameters functionality


> Date: Wed, 28 Apr 2010 10:17:50 +0100
> From: Phil Muldoon <pmuldoon@redhat.com>
> CC: gdb-patches@sourceware.org
> 
> In the case of PARAM_STRING (which directly maps to the GDB enum
> var_type {var_string} (found in command.h)), the string is parsed one
> character at a time. If the character being currently processed equals
> a '\', parse_escape (utils.c) is called with the pointer to the string
> that points to this character as an argument.  The parse_escape
> function seems to be called during most output emitted by GDB.  In
> parse escape, the character after the '\' is fetched, and that
> character runs through an a switch.
> 
> If the case is a literal octal, the next two characters are fetched
> and converted to the character the octal escape sequence
> represents. (i.e. in our example \107 will be translated to 'G')
> 
> If the character is an a,b,f,n,r,t, or v then that character is
> returned as '\a', or '\b', or '\f' and so on.  This means that in the
> string 'Good\tDay', \t will be processed and returned as it is. So C
> escape characters are acknowledged and returned intact.

Thank you for your effort.  In that case, I suggest the following
text:

 @item PARAM_STRING
 The value is a string.  When the user modifies the string, any escape
 sequences, such as @samp{\t}, @samp{\f}, and octal escapes, are
 translated into corresponding characters and encoded into the current
 host charset.

(Is it true that GDB encodes into host charset?  If not, please modify
as appropriate.)


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